pub struct CrossFieldValidator<'a, T> { /* private fields */ }Expand description
Cross-field validation helper.
Implementations§
Source§impl<'a, T> CrossFieldValidator<'a, T>
impl<'a, T> CrossFieldValidator<'a, T>
Sourcepub fn add_error(&mut self, fields: &[&str], message: impl Into<String>)
pub fn add_error(&mut self, fields: &[&str], message: impl Into<String>)
Add a cross-field validation error.
Sourcepub fn add_if(
&mut self,
condition: bool,
fields: &[&str],
message: impl Into<String>,
)
pub fn add_if( &mut self, condition: bool, fields: &[&str], message: impl Into<String>, )
Add error if condition is true.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if there are any errors.
Sourcepub fn into_errors(self) -> ValidationErrors
pub fn into_errors(self) -> ValidationErrors
Consume and return the errors.
Auto Trait Implementations§
impl<'a, T> Freeze for CrossFieldValidator<'a, T>
impl<'a, T> RefUnwindSafe for CrossFieldValidator<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for CrossFieldValidator<'a, T>where
T: Sync,
impl<'a, T> Sync for CrossFieldValidator<'a, T>where
T: Sync,
impl<'a, T> Unpin for CrossFieldValidator<'a, T>
impl<'a, T> UnsafeUnpin for CrossFieldValidator<'a, T>
impl<'a, T> UnwindSafe for CrossFieldValidator<'a, T>where
T: RefUnwindSafe,
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