pub struct StringSchema {
pub type_: StringTypeConst,
pub title: Option<Cow<'static, str>>,
pub description: Option<Cow<'static, str>>,
pub min_length: Option<u32>,
pub max_length: Option<u32>,
pub format: Option<StringFormat>,
}Expand description
Schema definition for string properties.
Fields§
§type_: StringTypeConst§title: Option<Cow<'static, str>>§description: Option<Cow<'static, str>>§min_length: Option<u32>§max_length: Option<u32>§format: Option<StringFormat>Implementations§
Source§impl StringSchema
impl StringSchema
pub fn new() -> Self
pub fn email() -> Self
pub fn uri() -> Self
pub fn date() -> Self
pub fn date_time() -> Self
pub fn title(self, title: impl Into<Cow<'static, str>>) -> Self
pub fn description(self, description: impl Into<Cow<'static, str>>) -> Self
pub fn with_length(self, min: u32, max: u32) -> Result<Self, &'static str>
pub fn length(self, min: u32, max: u32) -> Self
pub fn min_length(self, min: u32) -> Self
pub fn max_length(self, max: u32) -> Self
pub fn format(self, format: StringFormat) -> Self
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 · 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§impl<'de> Deserialize<'de> for StringSchema
impl<'de> Deserialize<'de> for StringSchema
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
Source§impl PartialEq for StringSchema
impl PartialEq for StringSchema
Source§impl Serialize for StringSchema
impl Serialize 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 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