pub struct PasswordHash(/* private fields */);Expand description
A stored password hash, such as the value of a user’s password column.
The debug output is PasswordHash([redacted]), and the type doesn’t implement Serialize, so a
struct that holds a hash can’t put it in a JSON response or a log line by accident. With the
database feature, a PasswordHash binds and decodes as text.
use laravel::hash::PasswordHash;
let hash = PasswordHash::from("$2y$12$L6Bc/AlTQHyd9liGgGEZyOFLPHNgyxeEPfgYfBCVxJ7JIlwxyVU3u");
assert_eq!(format!("{hash:?}"), "PasswordHash([redacted])");
assert!(hash.as_str().starts_with("$2y$12$"));Implementations§
Source§impl PasswordHash
impl PasswordHash
Trait Implementations§
Source§impl AsRef<str> for PasswordHash
impl AsRef<str> for PasswordHash
Source§impl Clone for PasswordHash
impl Clone for PasswordHash
Source§fn clone(&self) -> PasswordHash
fn clone(&self) -> PasswordHash
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PasswordHash
impl Debug for PasswordHash
Source§impl Decode for PasswordHash
impl Decode for PasswordHash
Source§fn decode(row: &AnyRow, index: usize) -> Result<PasswordHash, Error>
fn decode(row: &AnyRow, index: usize) -> Result<PasswordHash, Error>
Decode the column at the zero-based position
index. Read moreSource§const NULLABLE: bool = false
const NULLABLE: bool = false
Whether SQL NULL decodes into this type, as it does into
Option<T>.
When false, AnyRow::try_get fails on NULL without calling Decode::decode.Source§impl<'r, DB> Decode<'r, DB> for PasswordHash
impl<'r, DB> Decode<'r, DB> for PasswordHash
Source§impl<'q, DB> Encode<'q, DB> for PasswordHash
impl<'q, DB> Encode<'q, DB> for PasswordHash
Source§fn encode_by_ref(
&self,
buffer: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn encode_by_ref( &self, buffer: &mut <DB as Database>::ArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
Source§fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
fn encode(
self,
buf: &mut <DB as Database>::ArgumentBuffer,
) -> Result<IsNull, Box<dyn Error + Sync + Send>>where
Self: Sized,
Writes the value of
self into buf in the expected format for the database.fn produces(&self) -> Option<<DB as Database>::TypeInfo>
fn size_hint(&self) -> usize
impl Eq for PasswordHash
Source§impl FillValue<PasswordHash> for String
impl FillValue<PasswordHash> for String
Source§impl FillValue<PasswordHash> for &str
impl FillValue<PasswordHash> for &str
Source§impl FillValue<PasswordHash> for &String
impl FillValue<PasswordHash> for &String
Source§impl FillValue<PasswordHash> for Password
impl FillValue<PasswordHash> for Password
Source§impl FillValue<PasswordHash> for &Password
impl FillValue<PasswordHash> for &Password
Source§impl<'a> From<&&'a PasswordHash> for Value<'a>
impl<'a> From<&&'a PasswordHash> for Value<'a>
Source§fn from(value: &&'a PasswordHash) -> Value<'a>
fn from(value: &&'a PasswordHash) -> Value<'a>
Converts to this type from the input type.
Source§impl<'a> From<&'a PasswordHash> for Value<'a>
impl<'a> From<&'a PasswordHash> for Value<'a>
Source§fn from(value: &'a PasswordHash) -> Value<'a>
fn from(value: &'a PasswordHash) -> Value<'a>
Converts to this type from the input type.
Source§impl From<&str> for PasswordHash
impl From<&str> for PasswordHash
Source§fn from(hash: &str) -> PasswordHash
fn from(hash: &str) -> PasswordHash
Converts to this type from the input type.
Source§impl From<PasswordHash> for Value<'_>
impl From<PasswordHash> for Value<'_>
Source§fn from(value: PasswordHash) -> Value<'_>
fn from(value: PasswordHash) -> Value<'_>
Converts to this type from the input type.
Source§impl From<String> for PasswordHash
impl From<String> for PasswordHash
Source§fn from(hash: String) -> PasswordHash
fn from(hash: String) -> PasswordHash
Converts to this type from the input type.
Source§impl Nullable for PasswordHash
impl Nullable for PasswordHash
Source§impl PartialEq for PasswordHash
impl PartialEq for PasswordHash
impl StructuralPartialEq for PasswordHash
Source§impl<DB> Type<DB> for PasswordHash
impl<DB> Type<DB> for PasswordHash
Auto Trait Implementations§
impl Forget for PasswordHash
impl Freeze for PasswordHash
impl Move for PasswordHash
impl RefUnwindSafe for PasswordHash
impl Send for PasswordHashwhere
RawVecInner: Send,
impl Sync for PasswordHashwhere
RawVecInner: Sync,
impl Unpin for PasswordHash
impl UnsafeUnpin for PasswordHash
impl UnwindSafe for PasswordHashwhere
RawVecInner: UnwindSafe,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ComparableTo<Option<T>> for T
impl<T> ComparableTo<Option<T>> for T
Source§impl<T> ComparableTo<T> for T
impl<T> ComparableTo<T> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<I> IntoResettable<String> for I
impl<I> IntoResettable<String> for I
Source§fn into_resettable(self) -> Resettable<String>
fn into_resettable(self) -> Resettable<String>
Convert to the intended resettable type
Creates a shared type from an unshared type.