pub trait Test<Input, const ARITY: usize = 1> {
type Error<'i>: Display
where Input: 'i;
const ADJECTIVE: &str;
// Required method
fn test(input: [&Input; ARITY]) -> Result<(), Self::Error<'_>>;
}
Expand description
Function-like type that checks an invariant and optionally provides an error message.
Takes an arity parameter useful e.g. for comparing pairs, since you want to take references for each element of the pair, but the pair itself has to be a temporary value.
Required Associated Constants§
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.