pub trait AssertionFormat: Format<Value = AssertionFailure<Self::Context>> {
    type Context;
}
Expand description

A formatter for failed assertions.

This formatter is used to determine the format of the assertion as a whole, as opposed to just a specific matcher. When you use the expect! macro, you’re implicitly using the provided DefaultAssertionFormat. However, you can implement this trait and use Assertion::new instead to customize how assertions are formatted.

This trait has a blanket implementation for types that implement Format where Format::Value is an AssertionFailure, so you should never need to implement this trait yourself.

Required Associated Types§

source

type Context

The context value associated with the assertion.

See AssertionFailure::ctx for details.

Implementors§

source§

impl<T, Ctx> AssertionFormat for Twhere T: Format<Value = AssertionFailure<Ctx>>,

§

type Context = Ctx