Skip to main content

Auth

Trait Auth 

Source
pub trait Auth<'a> {
    // Required methods
    fn access_token<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<String, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn to_json<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<String, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn base_api_url(&self) -> String;
    fn user_agent(&self) -> String;
}
Expand description

Trait for authentication methods

Required Methods§

Source

fn access_token<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<String, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn to_json<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<String, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn base_api_url(&self) -> String

Source

fn user_agent(&self) -> String

Implementations§

Source§

impl dyn Auth<'_>

Source

pub async fn auth_header(&mut self) -> Result<Headers, AuthError>

Trait Implementations§

Source§

impl Debug for dyn Auth<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<'a> Auth<'a> for CCGAuth

Source§

impl<'a> Auth<'a> for DevAuth

Source§

impl<'a> Auth<'a> for JWTAuth

Source§

impl<'a> Auth<'a> for OAuth