pub struct DispatchFormat<PosFmt, NegFmt> { /* private fields */ }
Expand description
A formatter which dispatches to different formatters depending on whether the matcher is negated or not.
This type is a MatcherFormat
that wraps two existing formatters, one for the positive case
(we expected the matcher to match) and one for the negative case (we expected the matcher to
fail). It dispatches to one of those formatters depending on whether the matcher is negated or
not.
Implementations§
Source§impl<PosFmt, NegFmt> DispatchFormat<PosFmt, NegFmt>
impl<PosFmt, NegFmt> DispatchFormat<PosFmt, NegFmt>
Sourcepub fn new(pos_fmt: PosFmt, neg_fmt: NegFmt) -> Self
pub fn new(pos_fmt: PosFmt, neg_fmt: NegFmt) -> Self
Create a new DispatchFormat
from two existing formatters.
This accepts a formatter for the positive case and the negative case respectively.
Trait Implementations§
Source§impl<PosFmt, NegFmt, PosFail, NegFail> Format for DispatchFormat<PosFmt, NegFmt>
impl<PosFmt, NegFmt, PosFail, NegFail> Format for DispatchFormat<PosFmt, NegFmt>
Auto Trait Implementations§
impl<PosFmt, NegFmt> Freeze for DispatchFormat<PosFmt, NegFmt>
impl<PosFmt, NegFmt> RefUnwindSafe for DispatchFormat<PosFmt, NegFmt>where
PosFmt: RefUnwindSafe,
NegFmt: RefUnwindSafe,
impl<PosFmt, NegFmt> Send for DispatchFormat<PosFmt, NegFmt>
impl<PosFmt, NegFmt> Sync for DispatchFormat<PosFmt, NegFmt>
impl<PosFmt, NegFmt> Unpin for DispatchFormat<PosFmt, NegFmt>
impl<PosFmt, NegFmt> UnwindSafe for DispatchFormat<PosFmt, NegFmt>where
PosFmt: UnwindSafe,
NegFmt: 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