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§
Auto Trait Implementations§
impl<T> Freeze for MinMaxRange<T>where
T: Freeze,
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§
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