Struct safelog::BoxSensitive
source · pub struct BoxSensitive<T>(pub(crate) Box<Sensitive<T>>);
Expand description
A wrapper suitable for logging and including in errors
This is a newtype around Box<Sensitive<T>>
.
This is useful particularly in errors,
where the box can help reduce the size of error variants
(for example ones containing large values like an OwnedChanTarget
).
BoxSensitive<T>
dereferences to Sensitive<T>
.
Tuple Fields§
§0: Box<Sensitive<T>>
Implementations§
source§impl<T> BoxSensitive<T>
impl<T> BoxSensitive<T>
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Return the innermost T
Methods from Deref<Target = Sensitive<T>>§
Trait Implementations§
source§impl<T: Binary> Binary for BoxSensitive<T>
impl<T: Binary> Binary for BoxSensitive<T>
source§impl<T: Clone> Clone for BoxSensitive<T>
impl<T: Clone> Clone for BoxSensitive<T>
source§fn clone(&self) -> BoxSensitive<T>
fn clone(&self) -> BoxSensitive<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for BoxSensitive<T>
impl<T: Debug> Debug for BoxSensitive<T>
source§impl<T> Deref for BoxSensitive<T>
impl<T> Deref for BoxSensitive<T>
source§impl<T: Display> Display for BoxSensitive<T>
impl<T: Display> Display for BoxSensitive<T>
source§impl<T> From<T> for BoxSensitive<T>
impl<T> From<T> for BoxSensitive<T>
source§fn from(t: T) -> BoxSensitive<T>
fn from(t: T) -> BoxSensitive<T>
Converts to this type from the input type.
source§impl<T: Hash> Hash for BoxSensitive<T>
impl<T: Hash> Hash for BoxSensitive<T>
source§impl<T: LowerExp> LowerExp for BoxSensitive<T>
impl<T: LowerExp> LowerExp for BoxSensitive<T>
source§impl<T: LowerHex> LowerHex for BoxSensitive<T>
impl<T: LowerHex> LowerHex for BoxSensitive<T>
source§impl<T: Octal> Octal for BoxSensitive<T>
impl<T: Octal> Octal for BoxSensitive<T>
source§impl<T: Ord> Ord for BoxSensitive<T>
impl<T: Ord> Ord for BoxSensitive<T>
source§fn cmp(&self, other: &BoxSensitive<T>) -> Ordering
fn cmp(&self, other: &BoxSensitive<T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq> PartialEq for BoxSensitive<T>
impl<T: PartialEq> PartialEq for BoxSensitive<T>
source§fn eq(&self, other: &BoxSensitive<T>) -> bool
fn eq(&self, other: &BoxSensitive<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd> PartialOrd for BoxSensitive<T>
impl<T: PartialOrd> PartialOrd for BoxSensitive<T>
source§fn partial_cmp(&self, other: &BoxSensitive<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &BoxSensitive<T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T: Pointer> Pointer for BoxSensitive<T>
impl<T: Pointer> Pointer for BoxSensitive<T>
source§impl<T: UpperExp> UpperExp for BoxSensitive<T>
impl<T: UpperExp> UpperExp for BoxSensitive<T>
source§impl<T: UpperHex> UpperHex for BoxSensitive<T>
impl<T: UpperHex> UpperHex for BoxSensitive<T>
impl<T: Eq> Eq for BoxSensitive<T>
impl<T> StructuralPartialEq for BoxSensitive<T>
Auto Trait Implementations§
impl<T> Freeze for BoxSensitive<T>
impl<T> RefUnwindSafe for BoxSensitive<T>where
T: RefUnwindSafe,
impl<T> Send for BoxSensitive<T>where
T: Send,
impl<T> Sync for BoxSensitive<T>where
T: Sync,
impl<T> Unpin for BoxSensitive<T>
impl<T> UnwindSafe for BoxSensitive<T>where
T: 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
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