pub struct MaxLen<const MAX: usize>;Expand description
Accepts values with at most MAX elements (inclusive).
§Examples
use type_lib::rules::MaxLen;
use type_lib::Validator;
assert!(MaxLen::<5>::validate("hello").is_ok());
assert!(MaxLen::<5>::validate("too long").is_err());Trait Implementations§
Auto Trait Implementations§
impl<const MAX: usize> Freeze for MaxLen<MAX>
impl<const MAX: usize> RefUnwindSafe for MaxLen<MAX>
impl<const MAX: usize> Send for MaxLen<MAX>
impl<const MAX: usize> Sync for MaxLen<MAX>
impl<const MAX: usize> Unpin for MaxLen<MAX>
impl<const MAX: usize> UnsafeUnpin for MaxLen<MAX>
impl<const MAX: usize> UnwindSafe for MaxLen<MAX>
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