Struct de_lobby::auth::passwd::DbPassword
source · pub(super) struct DbPassword(Output, SaltString);
Expand description
Representation of a user password which can be safely loaded from and stored to a database.
Tuple Fields§
§0: Output
§1: SaltString
Implementations§
source§impl DbPassword
impl DbPassword
sourcepub(super) fn generate(password: &str) -> Result<Self>
pub(super) fn generate(password: &str) -> Result<Self>
Create new DB password from a non-hashed original password and a random salt.
fn new(hashed: Output, salt: SaltString) -> Self
fn hash(password: &str, salt: &SaltString) -> Result<Output>
sourcepub(super) fn b64_encode_pwd_hash(&self) -> Result<String>
pub(super) fn b64_encode_pwd_hash(&self) -> Result<String>
Returns Base64 encoded, hashed & salted password.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DbPassword
impl RefUnwindSafe for DbPassword
impl Send for DbPassword
impl Sync for DbPassword
impl Unpin for DbPassword
impl UnwindSafe for DbPassword
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more