pub struct FieldConfig { /* private fields */ }Expand description
Configuration for a validated field.
Implementations§
Source§impl FieldConfig
impl FieldConfig
Sourcepub fn new() -> FieldConfig
pub fn new() -> FieldConfig
Create a new field config.
Sourcepub fn add_validator<V>(self, validator: V) -> FieldConfigwhere
V: Validator + 'static,
pub fn add_validator<V>(self, validator: V) -> FieldConfigwhere
V: Validator + 'static,
Add a validator.
Sourcepub fn required(self) -> FieldConfig
pub fn required(self) -> FieldConfig
Add required validator.
Sourcepub fn min_length(self, min: usize) -> FieldConfig
pub fn min_length(self, min: usize) -> FieldConfig
Add min length validator.
Sourcepub fn max_length(self, max: usize) -> FieldConfig
pub fn max_length(self, max: usize) -> FieldConfig
Add max length validator.
Sourcepub fn range(self, min: f64, max: f64) -> FieldConfig
pub fn range(self, min: f64, max: f64) -> FieldConfig
Add range validator.
Sourcepub fn email(self) -> FieldConfig
pub fn email(self) -> FieldConfig
Add email pattern validator.
Sourcepub fn validate_on(self, trigger: ValidateOn) -> FieldConfig
pub fn validate_on(self, trigger: ValidateOn) -> FieldConfig
Set validation trigger.
Trait Implementations§
Source§impl Debug for FieldConfig
impl Debug for FieldConfig
Source§impl Default for FieldConfig
impl Default for FieldConfig
Source§fn default() -> FieldConfig
fn default() -> FieldConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for FieldConfig
impl !UnwindSafe for FieldConfig
impl Freeze for FieldConfig
impl Send for FieldConfig
impl Sync for FieldConfig
impl Unpin for FieldConfig
impl UnsafeUnpin for FieldConfig
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