Trait ClientSyncTrait

Source
pub trait ClientSyncTrait
where 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§

Source

fn new(instance: String) -> Self

Creates new ClientSync from a given instance and method.

Source

fn set_instance(&mut self, instance: String)

Modifies the instance of the ClientSync.

Source

fn get_instance(&self) -> &str

Returns the currently in use instance.

Source

fn fetch(&self, url: &str) -> Result<String, Box<dyn Error>>

Sends an http get request to the url and returns result.

Provided Methods§

Source

fn instance(self, instance: String) -> Self

Takes ownership of the instance and returns a new, modifed ClientSync with changed instance.

Source

fn stats(&self, params: Option<&str>) -> Result<Stats, InvidiousError>

/api/v1/stats endpoint.

Source

fn video(&self, id: &str, params: Option<&str>) -> Result<Video, InvidiousError>

/api/v1/videos/:ID endpoint.

Source

fn comments( &self, id: &str, params: Option<&str>, ) -> Result<Comments, InvidiousError>

/api/v1/comments/:ID endpoint.

Source

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.

Source

fn annotations( &self, id: &str, params: Option<&str>, ) -> Result<Annotations, InvidiousError>

/api/v1/annotations/:id endpoint.

Source

fn trending(&self, params: Option<&str>) -> Result<Trending, InvidiousError>

/api/v1/trending endpoint.

Source

fn popular(&self, params: Option<&str>) -> Result<Popular, InvidiousError>

/api/v1/popular endpoint.

Source

fn channel( &self, id: &str, params: Option<&str>, ) -> Result<Channel, InvidiousError>

/api/v1/channels/:ID endpoint.

Source

fn channel_videos( &self, id: &str, params: Option<&str>, ) -> Result<ChannelVideos, InvidiousError>

/api/v1/channel/videos/:ID endpoint.

Source

fn channel_playlists( &self, id: &str, params: Option<&str>, ) -> Result<ChannelPlaylists, InvidiousError>

/api/v1/channel/:ID/playlists endpoint.

Source

fn channel_comments( &self, id: &str, params: Option<&str>, ) -> Result<ChannelComments, InvidiousError>

/api/v1/channel/:id/comments endpoint.

/api/v1/channel/:id/search?q= endpoint.

Source

fn search(&self, params: Option<&str>) -> Result<Search, InvidiousError>

/api/v1/search endpoint.

Source

fn playlist( &self, id: &str, params: Option<&str>, ) -> Result<Playlist, InvidiousError>

/api/v1/playlists/:ID endpoint.

Source

fn mix(&self, id: &str, params: Option<&str>) -> Result<Mix, InvidiousError>

/api/v1/mixes/:ID endpoint.

Source

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.

Implementors§