pub struct ValidationSet { /* private fields */ }Expand description
Ordered collection of validation rules for a model type.
Implementations§
Source§impl ValidationSet
impl ValidationSet
Sourcepub fn add(
&mut self,
attribute: impl Into<String>,
validator: impl Validator + 'static,
)
pub fn add( &mut self, attribute: impl Into<String>, validator: impl Validator + 'static, )
Adds a validator for the given attribute.
Sourcepub fn validators_on(&self, attribute: &str) -> Vec<&dyn Validator>
pub fn validators_on(&self, attribute: &str) -> Vec<&dyn Validator>
Returns validators registered for the given attribute in registration order.
Trait Implementations§
Source§impl Default for ValidationSet
impl Default for ValidationSet
Source§fn default() -> ValidationSet
fn default() -> ValidationSet
Returns the “default value” for a type. Read more
Source§impl ValidationDsl for ValidationSet
impl ValidationDsl for ValidationSet
Auto Trait Implementations§
impl Freeze for ValidationSet
impl !RefUnwindSafe for ValidationSet
impl Send for ValidationSet
impl Sync for ValidationSet
impl Unpin for ValidationSet
impl UnsafeUnpin for ValidationSet
impl !UnwindSafe for ValidationSet
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> 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