pub struct MaxLength(pub usize);
Expand description
Rule to constraint the maximum
length of any type that implements AsRef<str>
such
as String
or &str
§Example
use type_rules::prelude::*;
#[derive(Validator)]
struct Payload(#[rule(MaxLength(200))] String);
Tuple Fields§
§0: usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MaxLength
impl RefUnwindSafe for MaxLength
impl Send for MaxLength
impl Sync for MaxLength
impl Unpin 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