pub struct RuleBuilder<T> { /* private fields */ }Expand description
Chainable rule builder for form fields.
Implementations§
Source§impl<T: 'static> RuleBuilder<T>
impl<T: 'static> RuleBuilder<T>
Source§impl RuleBuilder<String>
impl RuleBuilder<String>
Sourcepub fn required(self, err_msg: &str) -> Self
pub fn required(self, err_msg: &str) -> Self
Asserts that a string field is not empty or whitespace only.
Sourcepub fn email(self, err_msg: &str) -> Self
pub fn email(self, err_msg: &str) -> Self
Validates an email address via RFC-compliant RegExp or pattern match.
Sourcepub fn min_length(self, min: usize, err_msg: &str) -> Self
pub fn min_length(self, min: usize, err_msg: &str) -> Self
Enforces a minimum character length.
Sourcepub fn max_length(self, max: usize, err_msg: &str) -> Self
pub fn max_length(self, max: usize, err_msg: &str) -> Self
Enforces a maximum character length.
Sourcepub fn numeric_range(self, min: f64, max: f64, err_msg: &str) -> Self
pub fn numeric_range(self, min: f64, max: f64, err_msg: &str) -> Self
Validates a numeric range parsed from string.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for RuleBuilder<T>
impl<T> !Send for RuleBuilder<T>
impl<T> !Sync for RuleBuilder<T>
impl<T> !UnwindSafe for RuleBuilder<T>
impl<T> Freeze for RuleBuilder<T>
impl<T> Unpin for RuleBuilder<T>
impl<T> UnsafeUnpin for RuleBuilder<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