pub struct FieldSchema {
pub field_type: FieldType,
pub nullable: bool,
pub min: Option<f64>,
pub max: Option<f64>,
pub min_length: Option<usize>,
pub max_length: Option<usize>,
pub pattern: Option<String>,
pub enum_values: Option<Vec<Value>>,
pub items: Option<Box<FieldSchema>>,
pub properties: Option<HashMap<String, FieldSchema>>,
}Expand description
Schema for a single field.
Fields§
§field_type: FieldType§nullable: bool§min: Option<f64>§max: Option<f64>§min_length: Option<usize>§max_length: Option<usize>§pattern: Option<String>§enum_values: Option<Vec<Value>>§items: Option<Box<FieldSchema>>§properties: Option<HashMap<String, FieldSchema>>Implementations§
Source§impl FieldSchema
impl FieldSchema
pub fn new(field_type: FieldType) -> Self
pub fn string() -> Self
pub fn int() -> Self
pub fn float() -> Self
pub fn bool() -> Self
pub fn array(items: FieldSchema) -> Self
pub fn object() -> Self
pub fn nullable(self) -> Self
pub fn min(self, min: f64) -> Self
pub fn max(self, max: f64) -> Self
pub fn min_length(self, len: usize) -> Self
pub fn max_length(self, len: usize) -> Self
pub fn pattern(self, pattern: impl Into<String>) -> Self
pub fn enum_values(self, values: Vec<Value>) -> Self
Trait Implementations§
Source§impl Clone for FieldSchema
impl Clone for FieldSchema
Source§fn clone(&self) -> FieldSchema
fn clone(&self) -> FieldSchema
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 FieldSchema
impl Debug for FieldSchema
Source§impl<'de> Deserialize<'de> for FieldSchema
impl<'de> Deserialize<'de> for FieldSchema
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 FieldSchema
impl RefUnwindSafe for FieldSchema
impl Send for FieldSchema
impl Sync for FieldSchema
impl Unpin for FieldSchema
impl UnsafeUnpin for FieldSchema
impl UnwindSafe for FieldSchema
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