pub struct Client {
pub client: Client,
}Expand description
Client
Fields§
§client: ClientThe inner http client
Implementations§
Source§impl Client
impl Client
Sourcepub async fn get_main_page(&self) -> Result<MainPage, Error>
pub async fn get_main_page(&self) -> Result<MainPage, Error>
Sourcepub async fn get_video(
&self,
main_page: &MainPage,
url: &str,
) -> Result<GetVideoResponse, Error>
pub async fn get_video( &self, main_page: &MainPage, url: &str, ) -> Result<GetVideoResponse, Error>
Get a video for a reddit url.
main_page is exposed publicly as the same MainPage may be used for multiple Client::get_video calls as long as they are close together chronologically,
most likely at least a few seconds or minutes
Calling Client::get_main_page will also aquire a new session cookie if necessary,
so make sure to call get_main_page to refresh the csrf token if it expires
§Errors
Returns an error if the video url could not be fetched.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more