pub struct ConstraintLength {
pub min: Option<u64>,
pub max: Option<u64>,
}Expand description
A length constraint for string fields.
Enforces minimum and/or maximum character-count bounds on a string value.
Either bound can be None to leave that side unconstrained.
§Examples
use toasty_core::schema::app::ConstraintLength;
let c = ConstraintLength { min: Some(1), max: Some(255) };
assert_eq!(c.min, Some(1));
assert_eq!(c.max, Some(255));Fields§
§min: Option<u64>The minimum length of the field. None means no lower bound.
max: Option<u64>The maximum length of the field. None means no upper bound.
Trait Implementations§
Source§impl Clone for ConstraintLength
impl Clone for ConstraintLength
Source§fn clone(&self) -> ConstraintLength
fn clone(&self) -> ConstraintLength
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 ConstraintLength
impl Debug for ConstraintLength
Source§impl From<ConstraintLength> for Constraint
impl From<ConstraintLength> for Constraint
Source§fn from(length: ConstraintLength) -> Self
fn from(length: ConstraintLength) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ConstraintLength
impl RefUnwindSafe for ConstraintLength
impl Send for ConstraintLength
impl Sync for ConstraintLength
impl Unpin for ConstraintLength
impl UnwindSafe for ConstraintLength
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