Struct vos_core::StringConstraint
source · [−]pub struct StringConstraint {
pub min_bytes: Option<u32>,
pub max_bytes: Option<u32>,
pub min_length: Option<u32>,
pub max_length: Option<u32>,
pub info: SharedConstraint,
}Fields
min_bytes: Option<u32>Minimum length of utf8 string
max_bytes: Option<u32>Maximum length of utf8 string
min_length: Option<u32>Minimum number of unicode characters
max_length: Option<u32>Maximum number of unicode characters
info: SharedConstraintImplementations
sourceimpl StringConstraint
impl StringConstraint
sourcepub fn min_length(&mut self, n: &str) -> VosResult
pub fn min_length(&mut self, n: &str) -> VosResult
type Positive: i32 {
.positive
}type Integer: i32 {
.min: -1
}sourcepub fn max_length(&mut self, n: &str) -> VosResult
pub fn max_length(&mut self, n: &str) -> VosResult
type Integer: i32 {
.max: +1
}Trait Implementations
sourceimpl Clone for StringConstraint
impl Clone for StringConstraint
sourcefn clone(&self) -> StringConstraint
fn clone(&self) -> StringConstraint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for StringConstraint
impl Debug for StringConstraint
sourceimpl Default for StringConstraint
impl Default for StringConstraint
sourcefn default() -> StringConstraint
fn default() -> StringConstraint
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for StringConstraint
impl<'de> Deserialize<'de> for StringConstraint
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for StringConstraint
impl Serialize for StringConstraint
Auto Trait Implementations
impl RefUnwindSafe for StringConstraint
impl Send for StringConstraint
impl Sync for StringConstraint
impl Unpin for StringConstraint
impl UnwindSafe for StringConstraint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more