Struct type_rules::rules::In
source · [−]pub struct In<'a, T>(pub T, pub &'a str);
Expand description
Rule to constrain a type to be in
a collection
Example
use type_rules::prelude::*;
#[derive(Validator)]
struct Fruit(#[rule(In(["apple", "banana", "orange", "pear"], "Value need to be a fruit"))] String);
Tuple Fields
0: T
1: &'a str
Trait Implementations
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for In<'a, T> where
T: RefUnwindSafe,
impl<'a, T> Send for In<'a, T> where
T: Send,
impl<'a, T> Sync for In<'a, T> where
T: Sync,
impl<'a, T> Unpin for In<'a, T> where
T: Unpin,
impl<'a, T> UnwindSafe for In<'a, 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