Skip to main content

HasSecurePassword

Trait HasSecurePassword 

Source
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§

Source

fn password_digest(&self) -> &str

The stored bcrypt digest (e.g. the password_digest column).

Provided Methods§

Source

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".

Implementors§