#[non_exhaustive]pub enum LengthConstraint {
Exact(usize),
AtLeast(usize),
AtMost(usize),
Between {
min: usize,
max: usize,
},
}Expand description
A constraint on a byte or buffer length.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Exact(usize)
The length must equal this value.
AtLeast(usize)
The length must be at least this value.
AtMost(usize)
The length must be at most this value.
Between
The length must be within this inclusive range.
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 moreimpl Copy for LengthConstraint
Source§impl Debug for LengthConstraint
impl Debug for LengthConstraint
Source§impl Display for LengthConstraint
impl Display 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