Module format

Source
Expand description

The formatters provided by this crate.

The formatters in this module can be used to implement custom matchers without having to manually implement their formatting logic. You can use these formatters to get pretty formatting for free.

If you’re just writing tests and not writing custom matchers or formatters, you don’t need anything in this module.

The Format::Value of a formatter tells you what failure output it accepts. For example, MismatchFormat can format any matcher that returns a Mismatch.

See Writing Custom Matchers to learn how to implement your own matchers that use these provided formatters.

See Writing Custom Formatters to learn how to implement your own formatters like the ones in this module.

Modules§

diffdiff
Types for styling formatted diffs.

Structs§

ByFieldFormat
A formatter for FailuresByField values.
DiffFormatdiff
A formatter for Diff values.
ExpectationFormat
A formatter for Expectation values.
FailureFormat
A formatter for FormattedFailure values.
HeaderFormat
A formatter that adds a header to the output of another formatter.
InfallibleFormat
A formatter for matchers that never fail.
MessageFormat
A formatter which prints a static string message.
MismatchFormat
A formatter for Mismatch values.
SomeFailuresFormat
A formatter for SomeFailures values.
WhyFormat
A formatter that prints a context string provided by why or why_lazy.