pub trait HasSecurePassword {
// Required method
fn password_digest(&self) -> &str;
// Provided method
fn authenticate(&self, password: &str) -> bool { ... }
}Expand description
Gives a model that stores a bcrypt digest an authenticate method.
Required Methods§
Sourcefn password_digest(&self) -> &str
fn password_digest(&self) -> &str
The stored bcrypt digest (e.g. the password_digest column).
Provided Methods§
Sourcefn authenticate(&self, password: &str) -> bool
fn authenticate(&self, password: &str) -> bool
Return true when password matches the stored digest.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".