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§impl<T: PartialOrd> PartialOrd for WithPrettyDebug<T>
impl<T: PartialOrd> PartialOrd for WithPrettyDebug<T>
impl<T: Copy> Copy for WithPrettyDebug<T>
impl<T: Eq> Eq for WithPrettyDebug<T>
impl<T> StructuralPartialEq for WithPrettyDebug<T>
Auto Trait Implementations§
impl<T> Freeze for WithPrettyDebug<T>where
T: Freeze,
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