Struct type_rules::rules::MinMaxRange
source · [−]pub struct MinMaxRange<T: PartialOrd<T>>(pub T, pub T);
Expand description
Rule to constraint the minimum and maximum
range of any type that implement PartialOrd
Example
use type_rules::prelude::*;
#[derive(Validator)]
struct QueryParameters{
offset: u32,
#[rule(MinMaxRange(5, 50))]
limit: u8,
}
Tuple Fields
0: T
1: T
Trait Implementations
sourceimpl<T: PartialOrd<T>> Rule<T> for MinMaxRange<T>
impl<T: PartialOrd<T>> Rule<T> for MinMaxRange<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for MinMaxRange<T> where
T: RefUnwindSafe,
impl<T> Send for MinMaxRange<T> where
T: Send,
impl<T> Sync for MinMaxRange<T> where
T: Sync,
impl<T> Unpin for MinMaxRange<T> where
T: Unpin,
impl<T> UnwindSafe for MinMaxRange<T> where
T: UnwindSafe,
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