Trait OAuthApiClient

Source
pub trait OAuthApiClient: NadeoApiClient {
    // Required method
    async fn get_oauth_token(&self) -> Result<OAuthToken, String>;

    // Provided methods
    async fn get_oauth_permit_and_token(
        &self,
    ) -> Result<(OAuthToken, SemaphorePermit<'_>), String> { ... }
    async fn get_display_names<T>(
        &self,
        account_ids: &[T],
    ) -> Result<HashMap<String, String>, String>
       where T: Into<String> + Clone { ... }
}

Required Methods§

Source

async fn get_oauth_token(&self) -> Result<OAuthToken, String>

For adding API requests, use get_oauth_permit_and_token.

Provided Methods§

Source

async fn get_oauth_permit_and_token( &self, ) -> Result<(OAuthToken, SemaphorePermit<'_>), String>

Source

async fn get_display_names<T>( &self, account_ids: &[T], ) -> Result<HashMap<String, String>, String>
where T: Into<String> + Clone,

Get Display Names for a list of Uuids

https://webservices.openplanet.dev/oauth/reference/accounts/id-to-name

calls GET https://api.trackmania.com/api/display-names?accountId[]={accountId}

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§