pub struct RequiredValidator {
pub message: Option<String>,
}
Expand description
Validator that ensures a field is present and not empty
Fields§
§message: Option<String>
Custom error message
Implementations§
Trait Implementations§
Source§impl Clone for RequiredValidator
impl Clone for RequiredValidator
Source§fn clone(&self) -> RequiredValidator
fn clone(&self) -> RequiredValidator
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 RequiredValidator
impl Debug for RequiredValidator
Source§impl Default for RequiredValidator
impl Default for RequiredValidator
Source§impl ValidationRule for RequiredValidator
impl ValidationRule for RequiredValidator
Source§fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
value: &'life1 Value,
field: &'life2 str,
) -> Pin<Box<dyn Future<Output = ValidationResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
value: &'life1 Value,
field: &'life2 str,
) -> Pin<Box<dyn Future<Output = ValidationResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Validate a single value
Source§fn parameters(&self) -> Option<Value>
fn parameters(&self) -> Option<Value>
Get validation rule parameters/configuration as JSON
Auto Trait Implementations§
impl Freeze for RequiredValidator
impl RefUnwindSafe for RequiredValidator
impl Send for RequiredValidator
impl Sync for RequiredValidator
impl Unpin for RequiredValidator
impl UnwindSafe for RequiredValidator
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