Struct reddit_tube::Client
source · pub struct Client {
pub client: Client,
}
Expand description
Client
Fields§
§client: Client
The 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 !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