Min

Struct Min 

Source
pub struct Min<T>(/* private fields */);
Expand description

Ensures that a value is bounded from below by some other value. E.g. For strings, ensures that the length of the string is greater than some minimum. For integer types, ensures the value is greater than some minimum.

Implementations§

Source§

impl<T> Min<T>
where T: Ord,

Source

pub fn new(min: T) -> Self

Constructs a new Min validator.

Trait Implementations§

Source§

impl<T: Clone> Clone for Min<T>

Source§

fn clone(&self) -> Min<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Min<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Validator<&str> for Min<u16>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &&str) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<&str> for Min<u32>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &&str) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<&str> for Min<u64>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &&str) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<&str> for Min<u8>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &&str) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<&str> for Min<usize>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &&str) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<String> for Min<u16>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &String) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<String> for Min<u32>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &String) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<String> for Min<u64>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &String) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<String> for Min<u8>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &String) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<String> for Min<usize>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &String) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<i16> for Min<i16>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &i16) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<i32> for Min<i32>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &i32) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<i64> for Min<i64>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &i64) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<i8> for Min<i8>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &i8) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<isize> for Min<isize>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &isize) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<u16> for Min<u16>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &u16) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<u32> for Min<u32>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &u32) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<u64> for Min<u64>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &u64) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<u8> for Min<u8>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &u8) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl Validator<usize> for Min<usize>

Source§

type Error = ()

The error returned if validation fails.
Source§

fn validate(&self, value: &usize) -> Result<(), Self::Error>

Validates value. Read more
Source§

impl<T: Copy> Copy for Min<T>

Auto Trait Implementations§

§

impl<T> Freeze for Min<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Min<T>
where T: RefUnwindSafe,

§

impl<T> Send for Min<T>
where T: Send,

§

impl<T> Sync for Min<T>
where T: Sync,

§

impl<T> Unpin for Min<T>
where T: Unpin,

§

impl<T> UnwindSafe for Min<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.