pub trait Authenticator {
// Required method
fn authenticate(
&mut self,
) -> impl Future<Output = AuthResult<UserProfile>> + Send;
// Provided methods
fn verify(
&self,
token: &str,
) -> impl Future<Output = AuthResult<UserProfile>> + Send { ... }
fn logout(&self, token: &str) -> impl Future<Output = AuthResult<()>> + Send { ... }
}Expand description
Core authentication trait
All authentication providers must implement this trait
Required Methods§
Sourcefn authenticate(
&mut self,
) -> impl Future<Output = AuthResult<UserProfile>> + Send
fn authenticate( &mut self, ) -> impl Future<Output = AuthResult<UserProfile>> + Send
Provided Methods§
Sourcefn verify(
&self,
token: &str,
) -> impl Future<Output = AuthResult<UserProfile>> + Send
fn verify( &self, token: &str, ) -> impl Future<Output = AuthResult<UserProfile>> + Send
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.