Struct type_rules::rules::MaxLength
source · [−]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 RefUnwindSafe for MaxLength
impl Send for MaxLength
impl Sync for MaxLength
impl Unpin for MaxLength
impl UnwindSafe for MaxLength
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more