Struct unwind_context::WithPrettyDebug
source · pub struct WithPrettyDebug<T>(pub T);
Expand description
An utility wrapper type which is used to forward both core::fmt::Debug
and core::fmt::Display
value implementations to its core::fmt::Debug
implementation with pretty flag.
§Examples
use unwind_context::{unwind_context, WithPrettyDebug};
fn func(long_json: impl core::fmt::Debug) {
let _ctx = unwind_context!(fn(WithPrettyDebug(long_json)));
// ...
}
Tuple Fields§
§0: T
The wrapped value to be formatted with pretty
core::fmt::Debug
variant regardless of whether formatting is
invoked with core::fmt::Debug
or core::fmt::Display
formatter.
Trait Implementations§
source§impl<T: Clone> Clone for WithPrettyDebug<T>
impl<T: Clone> Clone for WithPrettyDebug<T>
source§fn clone(&self) -> WithPrettyDebug<T>
fn clone(&self) -> WithPrettyDebug<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 for WithPrettyDebug<T>where
T: Debug,
impl<T> Debug for WithPrettyDebug<T>where
T: Debug,
source§impl<T: Default> Default for WithPrettyDebug<T>
impl<T: Default> Default for WithPrettyDebug<T>
source§fn default() -> WithPrettyDebug<T>
fn default() -> WithPrettyDebug<T>
Returns the “default value” for a type. Read more
source§impl<T> Display for WithPrettyDebug<T>where
T: Debug,
impl<T> Display for WithPrettyDebug<T>where
T: Debug,
source§impl<T: Hash> Hash for WithPrettyDebug<T>
impl<T: Hash> Hash for WithPrettyDebug<T>
source§impl<T: Ord> Ord for WithPrettyDebug<T>
impl<T: Ord> Ord for WithPrettyDebug<T>
source§fn cmp(&self, other: &WithPrettyDebug<T>) -> Ordering
fn cmp(&self, other: &WithPrettyDebug<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 WithPrettyDebug<T>
impl<T: PartialEq> PartialEq for WithPrettyDebug<T>
source§fn eq(&self, other: &WithPrettyDebug<T>) -> bool
fn eq(&self, other: &WithPrettyDebug<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd> PartialOrd for WithPrettyDebug<T>
impl<T: PartialOrd> PartialOrd for WithPrettyDebug<T>
source§fn partial_cmp(&self, other: &WithPrettyDebug<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &WithPrettyDebug<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 moreimpl<T: Copy> Copy for WithPrettyDebug<T>
impl<T: Eq> Eq for WithPrettyDebug<T>
impl<T> StructuralPartialEq for WithPrettyDebug<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for WithPrettyDebug<T>where
T: RefUnwindSafe,
impl<T> Send for WithPrettyDebug<T>where
T: Send,
impl<T> Sync for WithPrettyDebug<T>where
T: Sync,
impl<T> Unpin for WithPrettyDebug<T>where
T: Unpin,
impl<T> UnwindSafe for WithPrettyDebug<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