pub struct ValidatorOptions {
pub allow_nil: bool,
pub allow_blank: bool,
pub on: Option<Vec<ValidationContext>>,
pub strict: bool,
pub if_cond: Option<ValidationPredicate>,
pub unless_cond: Option<ValidationPredicate>,
}Expand description
Shared runtime options applied by the validation runner.
Fields§
§allow_nil: boolSkips validation for missing or null values.
allow_blank: boolSkips validation for blank values such as empty strings.
on: Option<Vec<ValidationContext>>Restricts the validator to explicit contexts.
strict: boolRaises immediately instead of collecting produced errors.
if_cond: Option<ValidationPredicate>Runs the validator only when the predicate returns true.
unless_cond: Option<ValidationPredicate>Skips the validator when the predicate returns true.
Trait Implementations§
Source§impl Clone for ValidatorOptions
impl Clone for ValidatorOptions
Source§fn clone(&self) -> ValidatorOptions
fn clone(&self) -> ValidatorOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidatorOptions
impl Debug for ValidatorOptions
Source§impl Default for ValidatorOptions
impl Default for ValidatorOptions
Source§fn default() -> ValidatorOptions
fn default() -> ValidatorOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValidatorOptions
impl !RefUnwindSafe for ValidatorOptions
impl Send for ValidatorOptions
impl Sync for ValidatorOptions
impl Unpin for ValidatorOptions
impl UnsafeUnpin for ValidatorOptions
impl !UnwindSafe for ValidatorOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more