pub struct Validator<'a> { /* private fields */ }Implementations§
Source§impl<'a> Validator<'a>
impl<'a> Validator<'a>
pub fn new(data: &'a Value) -> Self
pub fn field<I>(self, field: impl Into<String>, rules: I) -> Selfwhere
I: IntoIterator<Item = BoxedRule>,
Sourcepub fn validate(&self) -> Result<(), ValidationErrors>
pub fn validate(&self) -> Result<(), ValidationErrors>
Run every registered rule and collect field-level errors.
§Errors
Returns all ValidationErrors when one or more rules fail.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Validator<'a>
impl<'a> !UnwindSafe for Validator<'a>
impl<'a> Freeze for Validator<'a>
impl<'a> Send for Validator<'a>
impl<'a> Sync for Validator<'a>
impl<'a> Unpin for Validator<'a>
impl<'a> UnsafeUnpin for Validator<'a>
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