pub struct DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>{
pub debug: DebugFmt,
pub display: DisplayFmt,
}
Expand description
Implements Debug
and Display
by calling the respective stored closure.
§Example
use fn_formats::DebugDisplayFmtSeparate;
let debug_display = DebugDisplayFmtSeparate {
debug: |f| write!(f, "debug"),
display: |f| write!(f, "display"),
};
assert_eq!(format!("{:?}", debug_display), "debug");
assert_eq!(format!("{}", debug_display), "display");
Fields§
§debug: DebugFmt
§display: DisplayFmt
Trait Implementations§
Source§impl<DebugFmt, DisplayFmt> Clone for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> Clone for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
Source§fn clone(&self) -> DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
fn clone(&self) -> DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
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<DebugFmt: Fn(&mut Formatter<'_>) -> Result, DisplayFmt: Fn(&mut Formatter<'_>) -> Result> Debug for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt: Fn(&mut Formatter<'_>) -> Result, DisplayFmt: Fn(&mut Formatter<'_>) -> Result> Debug for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
Source§impl<DebugFmt, DisplayFmt> Default for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> Default for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
Source§fn default() -> DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
fn default() -> DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
Returns the “default value” for a type. Read more
Source§impl<DebugFmt: Fn(&mut Formatter<'_>) -> Result, DisplayFmt: Fn(&mut Formatter<'_>) -> Result> Display for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt: Fn(&mut Formatter<'_>) -> Result, DisplayFmt: Fn(&mut Formatter<'_>) -> Result> Display for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
Source§impl<DebugFmt, DisplayFmt> Hash for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> Hash for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
Source§impl<DebugFmt, DisplayFmt> Ord for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> Ord for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
Source§fn cmp(&self, other: &DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>) -> Ordering
fn cmp(&self, other: &DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>) -> 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<DebugFmt, DisplayFmt> PartialEq for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> PartialEq for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
Source§fn eq(&self, other: &DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>) -> bool
fn eq(&self, other: &DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<DebugFmt, DisplayFmt> PartialOrd for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>where
DebugFmt: Fn(&mut Formatter<'_>) -> Result + PartialOrd,
DisplayFmt: Fn(&mut Formatter<'_>) -> Result + PartialOrd,
impl<DebugFmt, DisplayFmt> PartialOrd for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>where
DebugFmt: Fn(&mut Formatter<'_>) -> Result + PartialOrd,
DisplayFmt: Fn(&mut Formatter<'_>) -> Result + PartialOrd,
impl<DebugFmt, DisplayFmt> Copy for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> Eq for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> StructuralPartialEq for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
Auto Trait Implementations§
impl<DebugFmt, DisplayFmt> Freeze for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> RefUnwindSafe for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>where
DebugFmt: RefUnwindSafe,
DisplayFmt: RefUnwindSafe,
impl<DebugFmt, DisplayFmt> Send for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> Sync for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> Unpin for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>
impl<DebugFmt, DisplayFmt> UnwindSafe for DebugDisplayFmtSeparate<DebugFmt, DisplayFmt>where
DebugFmt: UnwindSafe,
DisplayFmt: 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