pub struct AnsiColored<T> {
pub value: T,
pub color_scheme: &'static AnsiColorScheme,
}
Expand description
An utility wrapper type is used to forward value core::fmt::Debug
implementation to DebugAnsiColored
implementation with a given
AnsiColorScheme
.
This type is not intended to be used directly. Consider using macros like
unwind_context
, unwind_context_with_io
or
unwind_context_with_fmt
instead.
Fields§
§value: T
The wrapped value to be formatted with DebugAnsiColored
.
color_scheme: &'static AnsiColorScheme
Selected color scheme.
Implementations§
Source§impl<T> AnsiColored<T>
impl<T> AnsiColored<T>
Sourcepub fn new(value: T, color_scheme: &'static AnsiColorScheme) -> Self
pub fn new(value: T, color_scheme: &'static AnsiColorScheme) -> Self
Wraps a given T
so its core::fmt::Debug
implementation will
forward to DebugAnsiColored
with a given color scheme.
§Examples
let arg = unwind_context::AnsiColored::new(
unwind_context::UnwindContextArg::new(Some("foo"), 123),
&unwind_context::DEFAULT_DEFAULT_COLOR_SCHEME,
);
Trait Implementations§
Source§impl<T: Clone> Clone for AnsiColored<T>
impl<T: Clone> Clone for AnsiColored<T>
Source§fn clone(&self) -> AnsiColored<T>
fn clone(&self) -> AnsiColored<T>
Returns a duplicate 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 AnsiColored<T>where
T: DebugAnsiColored,
impl<T> Debug for AnsiColored<T>where
T: DebugAnsiColored,
Source§impl<T: Hash> Hash for AnsiColored<T>
impl<T: Hash> Hash for AnsiColored<T>
Source§impl<T: Ord> Ord for AnsiColored<T>
impl<T: Ord> Ord for AnsiColored<T>
Source§fn cmp(&self, other: &AnsiColored<T>) -> Ordering
fn cmp(&self, other: &AnsiColored<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 AnsiColored<T>
impl<T: PartialEq> PartialEq for AnsiColored<T>
Source§impl<T: PartialOrd> PartialOrd for AnsiColored<T>
impl<T: PartialOrd> PartialOrd for AnsiColored<T>
impl<T: Copy> Copy for AnsiColored<T>
impl<T: Eq> Eq for AnsiColored<T>
impl<T> StructuralPartialEq for AnsiColored<T>
Auto Trait Implementations§
impl<T> Freeze for AnsiColored<T>where
T: Freeze,
impl<T> RefUnwindSafe for AnsiColored<T>where
T: RefUnwindSafe,
impl<T> Send for AnsiColored<T>where
T: Send,
impl<T> Sync for AnsiColored<T>where
T: Sync,
impl<T> Unpin for AnsiColored<T>where
T: Unpin,
impl<T> UnwindSafe for AnsiColored<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