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: SharedConstraint
Implementations§
Source§impl 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§
Source§impl Clone for StringConstraint
impl Clone for StringConstraint
Source§fn clone(&self) -> StringConstraint
fn clone(&self) -> StringConstraint
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 StringConstraint
impl Debug for StringConstraint
Source§impl Default for StringConstraint
impl Default for StringConstraint
Source§fn default() -> StringConstraint
fn default() -> StringConstraint
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for StringConstraint
impl<'de> Deserialize<'de> for StringConstraint
Source§fn 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
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