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