pub struct CompositeRule<T: ?Sized> { /* private fields */ }Expand description
A composite rule that combines multiple rules.
Implementations§
Trait Implementations§
Source§impl<T: ?Sized> Default for CompositeRule<T>
impl<T: ?Sized> Default for CompositeRule<T>
Source§impl<T: ?Sized + Sync> Rule<T> for CompositeRule<T>
impl<T: ?Sized + Sync> Rule<T> for CompositeRule<T>
Source§fn validate(&self, value: &T, ctx: &ValidationContext) -> ValidationResult<()>
fn validate(&self, value: &T, ctx: &ValidationContext) -> ValidationResult<()>
Validate the value.
Source§fn default_message(&self) -> String
fn default_message(&self) -> String
Get the default error message.
Source§fn validate_at(
&self,
value: &T,
path: &FieldPath,
ctx: &ValidationContext,
) -> ValidationResult<()>
fn validate_at( &self, value: &T, path: &FieldPath, ctx: &ValidationContext, ) -> ValidationResult<()>
Validate the value with a field path for error reporting.
Source§fn error_code(&self) -> String
fn error_code(&self) -> String
Get the error code.
Source§fn is_transform(&self) -> bool
fn is_transform(&self) -> bool
Check if this rule is a transformation (not validation).
Auto Trait Implementations§
impl<T> Freeze for CompositeRule<T>where
T: ?Sized,
impl<T> !RefUnwindSafe for CompositeRule<T>
impl<T> Send for CompositeRule<T>where
T: ?Sized,
impl<T> Sync for CompositeRule<T>where
T: ?Sized,
impl<T> Unpin for CompositeRule<T>where
T: ?Sized,
impl<T> !UnwindSafe for CompositeRule<T>
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