pub struct Constrains {
pub range: Range<Bound<String>>,
pub total_digits: Option<usize>,
pub fraction_digits: Option<usize>,
pub patterns: Vec<String>,
pub min_length: Option<usize>,
pub max_length: Option<usize>,
pub whitespace: WhiteSpace,
}Expand description
Constrains defined by the different facets of a type.
Fields§
§range: Range<Bound<String>>Range the value should be in.
total_digits: Option<usize>Number of total digits the value maximal should have.
fraction_digits: Option<usize>Number of fraction digits the value maximal should have.
patterns: Vec<String>Regex pattern the value should fulfill.
min_length: Option<usize>The minimum length the value should have.
max_length: Option<usize>The maximum length the value should have.
whitespace: WhiteSpaceDefines the whitespace handling.
Implementations§
Source§impl Constrains
impl Constrains
Sourcepub fn need_value_validation(&self) -> bool
pub fn need_value_validation(&self) -> bool
Returns true if this simple type needs value validation, false otherwise.
Sourcepub fn need_string_validation(&self) -> bool
pub fn need_string_validation(&self) -> bool
Returns true if this simple type needs string validation, false otherwise.
Trait Implementations§
Source§impl Clone for Constrains
impl Clone for Constrains
Source§fn clone(&self) -> Constrains
fn clone(&self) -> Constrains
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 Constrains
impl Debug for Constrains
Source§impl Default for Constrains
impl Default for Constrains
Source§impl Hash for Constrains
impl Hash for Constrains
Source§impl PartialEq for Constrains
impl PartialEq for Constrains
impl Eq for Constrains
impl StructuralPartialEq for Constrains
Auto Trait Implementations§
impl Freeze for Constrains
impl RefUnwindSafe for Constrains
impl Send for Constrains
impl Sync for Constrains
impl Unpin for Constrains
impl UnwindSafe for Constrains
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.