pub struct MaxLength { /* private fields */ }Expand description
Maximum length constraint for strings and collections.
Implementations§
Trait Implementations§
Source§impl<T> Constraint<[T]> for MaxLength
impl<T> Constraint<[T]> for MaxLength
Source§fn validate(&self, value: &[T]) -> ValidationResult
fn validate(&self, value: &[T]) -> ValidationResult
Validate the given value.
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Get a description of this constraint.
Source§impl Constraint<String> for MaxLength
Available on crate feature alloc only.
impl Constraint<String> for MaxLength
Available on crate feature
alloc only.Source§fn validate(&self, value: &String) -> ValidationResult
fn validate(&self, value: &String) -> ValidationResult
Validate the given value.
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Get a description of this constraint.
Source§impl<T> Constraint<Vec<T>> for MaxLength
Available on crate feature alloc only.
impl<T> Constraint<Vec<T>> for MaxLength
Available on crate feature
alloc only.Source§fn validate(&self, value: &Vec<T>) -> ValidationResult
fn validate(&self, value: &Vec<T>) -> ValidationResult
Validate the given value.
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Get a description of this constraint.
Source§impl Constraint<str> for MaxLength
impl Constraint<str> for MaxLength
Source§fn validate(&self, value: &str) -> ValidationResult
fn validate(&self, value: &str) -> ValidationResult
Validate the given value.
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Get a description of this constraint.
impl Copy for MaxLength
Auto Trait Implementations§
impl Freeze for MaxLength
impl RefUnwindSafe for MaxLength
impl Send for MaxLength
impl Sync for MaxLength
impl Unpin for MaxLength
impl UnsafeUnpin for MaxLength
impl UnwindSafe for MaxLength
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