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§
Sourcefn 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 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.
Trait Implementations§
Source§impl<'typetag> Serialize for dyn AnyAuthenticationMethod + 'typetag
impl<'typetag> Serialize for dyn AnyAuthenticationMethod + 'typetag
Source§impl<'typetag> Serialize for dyn AnyAuthenticationMethod + Send + 'typetag
impl<'typetag> Serialize for dyn AnyAuthenticationMethod + Send + 'typetag
Source§impl<'typetag> Serialize for dyn AnyAuthenticationMethod + Sync + 'typetag
impl<'typetag> Serialize for dyn AnyAuthenticationMethod + Sync + 'typetag
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".