Skip to main content

AnyAuthenticationMethod

Trait AnyAuthenticationMethod 

Source
pub trait AnyAuthenticationMethod:
    AnyExt
    + DatabaseConsumer
    + Serialize
    + Deserialize {
    // Required methods
    fn check<'life0, 'async_trait>(
        &'life0 self,
        db_conns: DbConns,
        entries: HashMap<CompactString, CompactString>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<UserId>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn new<'life0, 'async_trait>(
        &'life0 self,
        db_conns: DbConns,
        entries: HashMap<CompactString, CompactString>,
    ) -> Pin<Box<dyn Future<Output = Result<UserId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        db_conns: DbConns,
        user_id: UserId,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait implemented for every user authentication mechanism. Note that the auth data does not have to live in a SQL database…

Required Methods§

Source

fn check<'life0, 'async_trait>( &'life0 self, db_conns: DbConns, entries: HashMap<CompactString, CompactString>, ) -> Pin<Box<dyn Future<Output = Result<Option<UserId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check whether the given credentials match for a given user.

Source

fn new<'life0, 'async_trait>( &'life0 self, db_conns: DbConns, entries: HashMap<CompactString, CompactString>, ) -> Pin<Box<dyn Future<Output = Result<UserId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Signup a new user.

Source

fn delete<'life0, 'async_trait>( &'life0 self, db_conns: DbConns, user_id: UserId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Deletes a user given it’s id.

Trait Implementations§

Source§

impl<'typetag> Serialize for dyn AnyAuthenticationMethod + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn AnyAuthenticationMethod + Send + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn AnyAuthenticationMethod + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn AnyAuthenticationMethod + Send + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§