pub struct MinMaxLength(pub usize, pub usize);
Expand description
Rule to constraint the minimum and maximum
length of any type that implements AsRef<str>
such
as String
or &str
§Example
use type_rules::prelude::*;
#[derive(Validator)]
struct NewUser {
#[rule(MinMaxLength(3, 50))]
username: String,
#[rule(MinMaxLength(8, 100))]
password: String,
}
Tuple Fields§
§0: usize
§1: usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MinMaxLength
impl RefUnwindSafe for MinMaxLength
impl Send for MinMaxLength
impl Sync for MinMaxLength
impl Unpin for MinMaxLength
impl UnwindSafe for MinMaxLength
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