Skip to main content

OAuthProviderInterface

Trait OAuthProviderInterface 

Source
pub trait OAuthProviderInterface: Send + Sync {
    // Required methods
    fn id(&self) -> &'static str;
    fn name(&self) -> &'static str;
    fn login<'life0, 'async_trait>(
        &'life0 self,
        callbacks: OAuthLoginCallbacks,
    ) -> Pin<Box<dyn Future<Output = Result<OAuthCredentials>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn refresh_token<'life0, 'life1, 'async_trait>(
        &'life0 self,
        credentials: &'life1 OAuthCredentials,
    ) -> Pin<Box<dyn Future<Output = Result<OAuthCredentials>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_api_key(&self, credentials: &OAuthCredentials) -> String;

    // Provided methods
    fn uses_callback_server(&self) -> bool { ... }
    fn modify_models(
        &self,
        models: Vec<Model>,
        _credentials: &OAuthCredentials,
    ) -> Vec<Model> { ... }
}

Required Methods§

Source

fn id(&self) -> &'static str

Source

fn name(&self) -> &'static str

Source

fn login<'life0, 'async_trait>( &'life0 self, callbacks: OAuthLoginCallbacks, ) -> Pin<Box<dyn Future<Output = Result<OAuthCredentials>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn refresh_token<'life0, 'life1, 'async_trait>( &'life0 self, credentials: &'life1 OAuthCredentials, ) -> Pin<Box<dyn Future<Output = Result<OAuthCredentials>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_api_key(&self, credentials: &OAuthCredentials) -> String

Provided Methods§

Source

fn uses_callback_server(&self) -> bool

Source

fn modify_models( &self, models: Vec<Model>, _credentials: &OAuthCredentials, ) -> Vec<Model>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§