pub struct MaxLengthRule { /* private fields */ }Expand description
Validates that a string does not exceed a maximum length.
§Examples
use mx20022_validate::rules::length::MaxLengthRule;
use mx20022_validate::rules::Rule;
let rule = MaxLengthRule::new(35);
assert!(rule.validate("short text", "/path").is_empty());
assert!(!rule.validate(&"x".repeat(36), "/path").is_empty());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MaxLengthRule
impl RefUnwindSafe for MaxLengthRule
impl Send for MaxLengthRule
impl Sync for MaxLengthRule
impl Unpin for MaxLengthRule
impl UnsafeUnpin for MaxLengthRule
impl UnwindSafe for MaxLengthRule
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