pub trait Format {
type Value;
// Required method
fn fmt(&self, f: &mut Formatter, value: Self::Value) -> Result<()>;
}
Expand description
A generic formatter.
Implement this trait to create custom formatters. This works similarly to
std::fmt::Display
, where you call methods on the Formatter
to write to the output.
Required Associated Types§
Required Methods§
Implementations on Foreign Types§
Implementors§
source§impl Format for ByFieldFormat
impl Format for ByFieldFormat
source§impl Format for FailureFormat
impl Format for FailureFormat
source§impl Format for InfallibleFormat
impl Format for InfallibleFormat
type Value = MatchFailure<Infallible, Infallible>
source§impl Format for SomeFailuresFormat
impl Format for SomeFailuresFormat
source§impl Format for DefaultAssertionFormat
impl Format for DefaultAssertionFormat
type Value = AssertionFailure<AssertionContext>
source§impl<Actual> Format for ExpectationFormat<Actual>where
Actual: Debug,
impl<Actual> Format for ExpectationFormat<Actual>where Actual: Debug,
type Value = MatchFailure<Expectation<Actual>, Expectation<Actual>>
source§impl<Actual, Expected> Format for DiffFormat<Actual, Expected>where
Actual: Debug,
Expected: Diffable<Actual> + Debug,
Available on crate feature diff
only.
impl<Actual, Expected> Format for DiffFormat<Actual, Expected>where Actual: Debug, Expected: Diffable<Actual> + Debug,
Available on crate feature
diff
only.