pub trait Constraint {
// Required method
fn valid_range() -> RangeInclusive<i64>;
// Provided method
fn validate(value: i64) -> Result<i64, Error> { ... }
}
Expand description
A trait for defining constraints on Amount
Required Methods§
Sourcefn valid_range() -> RangeInclusive<i64>
fn valid_range() -> RangeInclusive<i64>
Returns the range of values that are valid under this constraint
Provided 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.