pub struct ClientAsync {
pub method: MethodAsync,
pub instance: String,
}Expand description
An async client, containing all info needed to perform a fetch.
Fields§
§method: MethodAsyncMethod of fetching, all methods in ClientAsync are async methods.
instance: StringA valid Invidious instance url.
Implementations§
Source§impl ClientAsync
impl ClientAsync
Sourcepub fn new(instance: String, method: MethodAsync) -> Self
pub fn new(instance: String, method: MethodAsync) -> Self
Creates new ClientAsync from a given instance and method.
Sourcepub fn set_instance(&mut self, instance: String)
pub fn set_instance(&mut self, instance: String)
Modifies the instance of the ClientAsync.
Sourcepub fn instance(self, instance: String) -> Self
pub fn instance(self, instance: String) -> Self
Takes ownership of the instance and returns a new, modifed ClientAsync with changed instance.
Sourcepub fn set_method(&mut self, method: MethodAsync)
pub fn set_method(&mut self, method: MethodAsync)
Modifies the method of the ClientAsync.
Sourcepub fn method(self, method: MethodAsync) -> Self
pub fn method(self, method: MethodAsync) -> Self
Takes ownership of the method and returns a new, modifed ClientAsync with changed method.
Trait Implementations§
Source§impl ClientAsyncTrait for ClientAsync
impl ClientAsyncTrait for ClientAsync
Source§fn set_instance(&mut self, instance: String)
fn set_instance(&mut self, instance: String)
Modifies the instance of the ClientAsync.
Source§fn get_instance(&self) -> &str
fn get_instance(&self) -> &str
Returns the currently in use instance.
Source§fn fetch<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sends an http get request to the url and returns result.
Source§fn instance(self, instance: String) -> Self
fn instance(self, instance: String) -> Self
Takes ownership of the instance and returns a new, modifed ClientAsync with changed instance.
Source§fn stats<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Stats, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stats<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Stats, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
/api/v1/stats endpoint.Source§fn video<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Video, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn video<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Video, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/videos/:ID endpoint.Source§fn comments<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Comments, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn comments<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Comments, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/comments/:ID endpoint.Source§fn captions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Captions, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn captions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Captions, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/captions/:ID endpoint. Read moreSource§fn annotations<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Annotations, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn annotations<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Annotations, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/comments/:ID endpoint.Source§fn trending<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Trending, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn trending<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Trending, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
/api/v1/trending endpoint.Source§fn popular<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Popular, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn popular<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Popular, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
/api/v1/popular endpoint.Source§fn channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Channel, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn channel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Channel, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/channels/:ID endpoint.Source§fn channel_videos<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<ChannelVideos, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn channel_videos<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<ChannelVideos, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/channel/videos/:ID endpoint.Source§fn channel_playlists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<ChannelPlaylists, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn channel_playlists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<ChannelPlaylists, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/channel/playlists/:ID endpoint.Source§fn channel_comments<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<ChannelComments, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn channel_comments<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<ChannelComments, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/channel/playlists/:ID endpoint.Source§fn channel_search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<ChannelSearch, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn channel_search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<ChannelSearch, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/channel/playlists/:ID endpoint.Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Search, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Search, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
/api/v1/search endpoint.Source§fn playlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Playlist, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn playlist<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Playlist, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/playlists/:ID endpoint.Source§fn mix<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Mix, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn mix<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
params: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Mix, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
/api/v1/mixes/:ID endpoint.Source§fn search_suggestions<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Suggestions, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_suggestions<'life0, 'life1, 'async_trait>(
&'life0 self,
params: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Suggestions, InvidiousError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
/api/v1/search/suggestions endpoint.Source§impl Clone for ClientAsync
impl Clone for ClientAsync
Source§fn clone(&self) -> ClientAsync
fn clone(&self) -> ClientAsync
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ClientAsync
Available on crate feature async only.
impl Default for ClientAsync
Available on crate feature
async only.impl ClientAsyncClone for ClientAsync
Available on crate feature
async only.Auto Trait Implementations§
impl Freeze for ClientAsync
impl RefUnwindSafe for ClientAsync
impl Send for ClientAsync
impl Sync for ClientAsync
impl Unpin for ClientAsync
impl UnwindSafe for ClientAsync
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