pub trait Predicate<T: ?Sized> {
// Required methods
fn check(value: &T) -> bool;
fn expect(formatter: &mut Formatter<'_>) -> Result;
fn expect_code(formatter: &mut Formatter<'_>) -> Result;
// Provided method
fn check_value(value: T) -> bool
where T: Sized { ... }
}Expand description
Represents predicates over values of type T.
Required Methods§
Sourcefn expect(formatter: &mut Formatter<'_>) -> Result
fn expect(formatter: &mut Formatter<'_>) -> Result
Formats the expectation of this predicate into the given formatter.
§Errors
Returns fmt::Error in case formatting fails.
Sourcefn expect_code(formatter: &mut Formatter<'_>) -> Result
fn expect_code(formatter: &mut Formatter<'_>) -> Result
Formats the expectation code of this predicate into the given formatter.
§Errors
Returns fmt::Error in case formatting fails.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".