pub enum LengthConstraint {
Exact(usize),
AtLeast(usize),
AtMost(usize),
InRange {
min: usize,
max: usize,
},
}Expand description
A numeric relationship required of a measured string or collection length.
LengthMetric identifies the measurement unit in a
structured validation error.
Variants§
Exact(usize)
Requires exactly the specified length.
AtLeast(usize)
Requires at least the specified length.
AtMost(usize)
Requires at most the specified length.
InRange
Requires a length between min and max, inclusive.
Trait Implementations§
Source§impl Clone for LengthConstraint
impl Clone for LengthConstraint
Source§fn clone(&self) -> LengthConstraint
fn clone(&self) -> LengthConstraint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LengthConstraint
impl Debug for LengthConstraint
impl Eq for LengthConstraint
Source§impl PartialEq for LengthConstraint
impl PartialEq for LengthConstraint
impl StructuralPartialEq for LengthConstraint
Auto Trait Implementations§
impl Freeze for LengthConstraint
impl RefUnwindSafe for LengthConstraint
impl Send for LengthConstraint
impl Sync for LengthConstraint
impl Unpin for LengthConstraint
impl UnsafeUnpin for LengthConstraint
impl UnwindSafe for LengthConstraint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more