Struct type_rules::rules::Or
source · [−]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> RefUnwindSafe for Or<T, U> where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for Or<T, U> where
T: Send,
U: Send,
impl<T, U> Sync for Or<T, U> where
T: Sync,
U: Sync,
impl<T, U> Unpin for Or<T, U> where
T: Unpin,
U: Unpin,
impl<T, U> UnwindSafe for Or<T, U> where
T: UnwindSafe,
U: 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