Skip to main content

assertr/
condition.rs

1use core::fmt::Display;
2
3pub trait Condition<T> {
4    type Error: Display;
5
6    /// Test that the actual `value` conforms to / matches this condition (`self`).
7    ///
8    /// # Errors
9    ///
10    /// Returns an error describing why the value does not match the condition.
11    fn test(&self, value: &T) -> Result<(), Self::Error>;
12}