pub struct Any<'a, T>(pub T, pub &'a str);
Expand description
Rule to constrain an iterable collection (with reference) to valid that any element of the collection valid the specified rule
§Example
use type_rules::prelude::*;
#[derive(Validator)]
struct VecNotEmptyString(
#[rule(Any(MinLength(10), "At least one element need to be of length >= 10"))]
Vec<String>
);
Tuple Fields§
§0: T
§1: &'a str
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Any<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for Any<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Any<'a, T>where
T: Send,
impl<'a, T> Sync for Any<'a, T>where
T: Sync,
impl<'a, T> Unpin for Any<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for Any<'a, 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