pub struct Or<T, U>(pub T, pub U);
Expand description
Rule to apply an Or condition on two rules.
In case of error on both rules, the first one is returned.
§Example
use type_rules::prelude::*;
#[derive(Validator)]
struct NotZeroInteger(
#[rule(Or(MaxRange(-1), MinRange(1)))]
i32
);
Tuple Fields§
§0: T
§1: U
Trait Implementations§
Auto Trait Implementations§
impl<T, U> Freeze for Or<T, U>
impl<T, U> RefUnwindSafe for Or<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for Or<T, U>
impl<T, U> Sync for Or<T, U>
impl<T, U> Unpin for Or<T, U>
impl<T, U> UnwindSafe for Or<T, U>where
T: UnwindSafe,
U: 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