pub trait PasswordEncryption: Clone {
// Required methods
fn new(secret: impl ToString) -> Self;
fn encrypt_password(
&self,
credential: impl AsRef<str>,
) -> Result<String, Box<dyn Error + Send + Sync>>;
fn verify_password(
&self,
encrypted: impl AsRef<str>,
credential: impl AsRef<str>,
) -> bool;
}
Required Methods§
fn new(secret: impl ToString) -> Self
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.