Scheme

Trait Scheme 

Source
pub trait Scheme<User: Send + Sync + 'static> {
    type Request: Any + Send + Sync;

    // Required methods
    fn authenticate<'life0, 'life1, 'life2, 'async_trait, S>(
        &'life0 self,
        state: &'life1 S,
        auth_param: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<User>>> + Send + 'async_trait>>
       where S: Storage<User, Self::Request> + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn scheme_name() -> &'static str;

    // Provided methods
    fn should_401_on_multiple_values() -> bool { ... }
    fn should_403_on_bad_auth() -> bool { ... }
    fn header_name() -> &'static str { ... }
}

Required Associated Types§

Required Methods§

Source

fn authenticate<'life0, 'life1, 'life2, 'async_trait, S>( &'life0 self, state: &'life1 S, auth_param: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<User>>> + Send + 'async_trait>>
where S: Storage<User, Self::Request> + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn scheme_name() -> &'static str

Provided Methods§

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§