Skip to main content

AnimeApi

Trait AnimeApi 

Source
pub trait AnimeApi {
    type State: Request + Send + Sync;

    // Required method
    fn get_self(&self) -> &Self::State;

    // Provided methods
    fn get_anime_list<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 GetAnimeList,
    ) -> Pin<Box<dyn Future<Output = Result<AnimeList, AnimeApiError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_anime_details<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 GetAnimeDetails,
    ) -> Pin<Box<dyn Future<Output = Result<AnimeDetails, AnimeApiError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_anime_ranking<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 GetAnimeRanking,
    ) -> Pin<Box<dyn Future<Output = Result<AnimeRanking, AnimeApiError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_seasonal_anime<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 GetSeasonalAnime,
    ) -> Pin<Box<dyn Future<Output = Result<SeasonalAnime, AnimeApiError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn next<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        response: &'life1 T,
    ) -> Pin<Box<dyn Future<Output = Result<T, AnimeApiError>> + Send + 'async_trait>>
       where T: DeserializeOwned + PagingIter + Sync + Send + 'async_trait,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn prev<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        response: &'life1 T,
    ) -> Pin<Box<dyn Future<Output = Result<T, AnimeApiError>> + Send + 'async_trait>>
       where T: DeserializeOwned + PagingIter + Sync + Send + 'async_trait,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

This trait defines the shared endpoints for Client and Oauth AnimeApiClients. It provides default implementations such that the Oauth AnimeApiClient can override them if needed.

Required Associated Types§

Required Methods§

Source

fn get_self(&self) -> &Self::State

Utility method for API trait to use the appropriate request method

Provided Methods§

Source

fn get_anime_list<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 GetAnimeList, ) -> Pin<Box<dyn Future<Output = Result<AnimeList, AnimeApiError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a list of anime that are similar to the given query

Corresponds to the Get anime list endpoint

Source

fn get_anime_details<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 GetAnimeDetails, ) -> Pin<Box<dyn Future<Output = Result<AnimeDetails, AnimeApiError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the details of an anime that matches the given query

Corresponds to the Get anime details endpoint

Source

fn get_anime_ranking<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 GetAnimeRanking, ) -> Pin<Box<dyn Future<Output = Result<AnimeRanking, AnimeApiError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the ranking of anime

Corresponds to the Get anime ranking endpoint

Source

fn get_seasonal_anime<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 GetSeasonalAnime, ) -> Pin<Box<dyn Future<Output = Result<SeasonalAnime, AnimeApiError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the seasonal anime that fall within the given query

Corresponds to the Get seasonal anime endpoint

Source

fn next<'life0, 'life1, 'async_trait, T>( &'life0 self, response: &'life1 T, ) -> Pin<Box<dyn Future<Output = Result<T, AnimeApiError>> + Send + 'async_trait>>
where T: DeserializeOwned + PagingIter + Sync + Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return the results of the next page, if possible

Source

fn prev<'life0, 'life1, 'async_trait, T>( &'life0 self, response: &'life1 T, ) -> Pin<Box<dyn Future<Output = Result<T, AnimeApiError>> + Send + 'async_trait>>
where T: DeserializeOwned + PagingIter + Sync + Send + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return the results of the previous page, if possible

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§