Struct xpct::format::HeaderFormat
source · pub struct HeaderFormat<Fmt> { /* private fields */ }
Expand description
A formatter that adds a header to the output of another formatter.
Examples
let formatter = HeaderFormat::new(
SomeFailuresFormat::new(),
"Expected at least one of these to match:",
"Expected all of these to match:",
);
Implementations§
source§impl<Fmt> HeaderFormat<Fmt>
impl<Fmt> HeaderFormat<Fmt>
sourcepub fn new(
inner: Fmt,
pos_header: impl Into<String>,
neg_header: impl Into<String>
) -> Self
pub fn new( inner: Fmt, pos_header: impl Into<String>, neg_header: impl Into<String> ) -> Self
Create a new HeaderFormat
from the header string and inner formatter.
This accepts two header strings, one for the positive case and one for the negative case respectively. The first is used normally, and the second is used when the matcher is negated.
Trait Implementations§
source§impl<Fmt: Debug> Debug for HeaderFormat<Fmt>
impl<Fmt: Debug> Debug for HeaderFormat<Fmt>
source§impl<Fmt: Default> Default for HeaderFormat<Fmt>
impl<Fmt: Default> Default for HeaderFormat<Fmt>
source§fn default() -> HeaderFormat<Fmt>
fn default() -> HeaderFormat<Fmt>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<Fmt> RefUnwindSafe for HeaderFormat<Fmt>where Fmt: RefUnwindSafe,
impl<Fmt> Send for HeaderFormat<Fmt>where Fmt: Send,
impl<Fmt> Sync for HeaderFormat<Fmt>where Fmt: Sync,
impl<Fmt> Unpin for HeaderFormat<Fmt>where Fmt: Unpin,
impl<Fmt> UnwindSafe for HeaderFormat<Fmt>where Fmt: 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