pub struct StringSchema {
pub constant: Option<String>,
pub choices: Option<Vec<String>>,
pub format: Option<StringFormat>,
pub format_name: Option<String>,
pub min_length: Option<usize>,
pub max_length: Option<usize>,
pub min_graphemes: Option<usize>,
pub max_graphemes: Option<usize>,
}Expand description
A string schema and everything that constrains it.
Fields§
§constant: Option<String>The only value permitted, if the schema names one.
choices: Option<Vec<String>>The closed set of permitted values, if the schema names one.
Distinct from knownValues, which is open and is not enforced.
format: Option<StringFormat>The declared format, if this build recognises it.
format_name: Option<String>The format name as written, kept even when unrecognised so that an error can name it.
min_length: Option<usize>Minimum length in UTF-8 bytes.
max_length: Option<usize>Maximum length in UTF-8 bytes.
min_graphemes: Option<usize>Minimum length in grapheme clusters.
max_graphemes: Option<usize>Maximum length in grapheme clusters.
Trait Implementations§
Source§impl Clone for StringSchema
impl Clone for StringSchema
Source§fn clone(&self) -> StringSchema
fn clone(&self) -> StringSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StringSchema
impl Debug for StringSchema
Source§impl Default for StringSchema
impl Default for StringSchema
Source§fn default() -> StringSchema
fn default() -> StringSchema
Returns the “default value” for a type. Read more
Source§impl PartialEq for StringSchema
impl PartialEq for StringSchema
Source§fn eq(&self, other: &StringSchema) -> bool
fn eq(&self, other: &StringSchema) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for StringSchema
impl StructuralPartialEq for StringSchema
Auto Trait Implementations§
impl Freeze for StringSchema
impl RefUnwindSafe for StringSchema
impl Send for StringSchema
impl Sync for StringSchema
impl Unpin for StringSchema
impl UnsafeUnpin for StringSchema
impl UnwindSafe for StringSchema
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.