pub trait UserLookup:
Send
+ Sync
+ 'static {
// Required method
fn find_user(
&self,
username: &str,
) -> Effect<Option<UserCredentials>, AuthError>;
// Provided method
fn update_password_hash(
&self,
username: &str,
hash: PasswordHash,
) -> Effect<(), AuthError> { ... }
}Expand description
Capability seam: finds a user’s credentials by login name. Implement it over the user table.
Required Methods§
Provided Methods§
Sourcefn update_password_hash(
&self,
username: &str,
hash: PasswordHash,
) -> Effect<(), AuthError>
fn update_password_hash( &self, username: &str, hash: PasswordHash, ) -> Effect<(), AuthError>
Store hash, the user’s password re-hashed under the current parameters. Called after a
successful login whose stored hash was outdated; the default keeps the old one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".