pub trait ClientSyncTraitwhere
Self: Sized,{
Show 21 methods
// Required methods
fn new(instance: String) -> Self;
fn set_instance(&mut self, instance: String);
fn get_instance(&self) -> &str;
fn fetch(&self, url: &str) -> Result<String, Box<dyn Error>>;
// Provided methods
fn instance(self, instance: String) -> Self { ... }
fn stats(&self, params: Option<&str>) -> Result<Stats, InvidiousError> { ... }
fn video(
&self,
id: &str,
params: Option<&str>,
) -> Result<Video, InvidiousError> { ... }
fn comments(
&self,
id: &str,
params: Option<&str>,
) -> Result<Comments, InvidiousError> { ... }
fn captions(
&self,
id: &str,
params: Option<&str>,
) -> Result<Captions, InvidiousError> { ... }
fn annotations(
&self,
id: &str,
params: Option<&str>,
) -> Result<Annotations, InvidiousError> { ... }
fn trending(&self, params: Option<&str>) -> Result<Trending, InvidiousError> { ... }
fn popular(&self, params: Option<&str>) -> Result<Popular, InvidiousError> { ... }
fn channel(
&self,
id: &str,
params: Option<&str>,
) -> Result<Channel, InvidiousError> { ... }
fn channel_videos(
&self,
id: &str,
params: Option<&str>,
) -> Result<ChannelVideos, InvidiousError> { ... }
fn channel_playlists(
&self,
id: &str,
params: Option<&str>,
) -> Result<ChannelPlaylists, InvidiousError> { ... }
fn channel_comments(
&self,
id: &str,
params: Option<&str>,
) -> Result<ChannelComments, InvidiousError> { ... }
fn channel_search(
&self,
id: &str,
params: Option<&str>,
) -> Result<ChannelSearch, InvidiousError> { ... }
fn search(&self, params: Option<&str>) -> Result<Search, InvidiousError> { ... }
fn playlist(
&self,
id: &str,
params: Option<&str>,
) -> Result<Playlist, InvidiousError> { ... }
fn mix(&self, id: &str, params: Option<&str>) -> Result<Mix, InvidiousError> { ... }
fn search_suggestions(
&self,
params: Option<&str>,
) -> Result<Suggestions, InvidiousError> { ... }
}
Expand description
Sync Invidious client
Required Methods§
Sourcefn set_instance(&mut self, instance: String)
fn set_instance(&mut self, instance: String)
Modifies the instance of the ClientSync.
Sourcefn get_instance(&self) -> &str
fn get_instance(&self) -> &str
Returns the currently in use instance.
Provided Methods§
Sourcefn instance(self, instance: String) -> Self
fn instance(self, instance: String) -> Self
Takes ownership of the instance and returns a new, modifed ClientSync with changed instance.
Sourcefn video(&self, id: &str, params: Option<&str>) -> Result<Video, InvidiousError>
fn video(&self, id: &str, params: Option<&str>) -> Result<Video, InvidiousError>
/api/v1/videos/:ID
endpoint.
Sourcefn comments(
&self,
id: &str,
params: Option<&str>,
) -> Result<Comments, InvidiousError>
fn comments( &self, id: &str, params: Option<&str>, ) -> Result<Comments, InvidiousError>
/api/v1/comments/:ID
endpoint.
Sourcefn captions(
&self,
id: &str,
params: Option<&str>,
) -> Result<Captions, InvidiousError>
fn captions( &self, id: &str, params: Option<&str>, ) -> Result<Captions, InvidiousError>
/api/v1/captions/:id
endpoint.
Use client.fetch(caption.url)
to get the real captions file.
Sourcefn annotations(
&self,
id: &str,
params: Option<&str>,
) -> Result<Annotations, InvidiousError>
fn annotations( &self, id: &str, params: Option<&str>, ) -> Result<Annotations, InvidiousError>
/api/v1/annotations/:id
endpoint.
Sourcefn trending(&self, params: Option<&str>) -> Result<Trending, InvidiousError>
fn trending(&self, params: Option<&str>) -> Result<Trending, InvidiousError>
/api/v1/trending
endpoint.
Sourcefn popular(&self, params: Option<&str>) -> Result<Popular, InvidiousError>
fn popular(&self, params: Option<&str>) -> Result<Popular, InvidiousError>
/api/v1/popular
endpoint.
Sourcefn channel(
&self,
id: &str,
params: Option<&str>,
) -> Result<Channel, InvidiousError>
fn channel( &self, id: &str, params: Option<&str>, ) -> Result<Channel, InvidiousError>
/api/v1/channels/:ID
endpoint.
Sourcefn channel_videos(
&self,
id: &str,
params: Option<&str>,
) -> Result<ChannelVideos, InvidiousError>
fn channel_videos( &self, id: &str, params: Option<&str>, ) -> Result<ChannelVideos, InvidiousError>
/api/v1/channel/videos/:ID
endpoint.
Sourcefn channel_playlists(
&self,
id: &str,
params: Option<&str>,
) -> Result<ChannelPlaylists, InvidiousError>
fn channel_playlists( &self, id: &str, params: Option<&str>, ) -> Result<ChannelPlaylists, InvidiousError>
/api/v1/channel/:ID/playlists
endpoint.
Sourcefn channel_comments(
&self,
id: &str,
params: Option<&str>,
) -> Result<ChannelComments, InvidiousError>
fn channel_comments( &self, id: &str, params: Option<&str>, ) -> Result<ChannelComments, InvidiousError>
/api/v1/channel/:id/comments
endpoint.
Sourcefn channel_search(
&self,
id: &str,
params: Option<&str>,
) -> Result<ChannelSearch, InvidiousError>
fn channel_search( &self, id: &str, params: Option<&str>, ) -> Result<ChannelSearch, InvidiousError>
/api/v1/channel/:id/search?q=
endpoint.
Sourcefn search(&self, params: Option<&str>) -> Result<Search, InvidiousError>
fn search(&self, params: Option<&str>) -> Result<Search, InvidiousError>
/api/v1/search
endpoint.
Sourcefn playlist(
&self,
id: &str,
params: Option<&str>,
) -> Result<Playlist, InvidiousError>
fn playlist( &self, id: &str, params: Option<&str>, ) -> Result<Playlist, InvidiousError>
/api/v1/playlists/:ID
endpoint.
Sourcefn mix(&self, id: &str, params: Option<&str>) -> Result<Mix, InvidiousError>
fn mix(&self, id: &str, params: Option<&str>) -> Result<Mix, InvidiousError>
/api/v1/mixes/:ID
endpoint.
Sourcefn search_suggestions(
&self,
params: Option<&str>,
) -> Result<Suggestions, InvidiousError>
fn search_suggestions( &self, params: Option<&str>, ) -> Result<Suggestions, InvidiousError>
/api/v1/search/suggestions
endpoint.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.