pub struct StringConstraint {
pub max_len: Option<usize>,
pub min_len: Option<usize>,
pub blacklist_chars: Vec<char>,
}
Expand description
String constraint config for applying constraints to what a string can be
Fields§
§max_len: Option<usize>
§min_len: Option<usize>
§blacklist_chars: Vec<char>
Trait Implementations§
Source§impl<T> Constraint<T> for StringConstraint
Implementing method to apply constraints on strings
impl<T> Constraint<T> for StringConstraint
Implementing method to apply constraints on strings
Source§fn validate(&self, data: &T) -> ConstraintResult
fn validate(&self, data: &T) -> ConstraintResult
Validates data to make sure it follows constraints
Auto Trait Implementations§
impl Freeze for StringConstraint
impl RefUnwindSafe for StringConstraint
impl Send for StringConstraint
impl Sync for StringConstraint
impl Unpin for StringConstraint
impl UnwindSafe for StringConstraint
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