pub struct FieldSchema {
pub name: String,
pub data_type: DataType,
pub constraints: FieldConstraints,
pub description: Option<String>,
pub generator_config: Option<HashMap<String, Value>>,
pub generator_type: Option<FieldGeneratorType>,
}Expand description
字段Schema
Fields§
§name: String字段名
data_type: DataType数据类型
constraints: FieldConstraints约束条件
description: Option<String>描述
generator_config: Option<HashMap<String, Value>>生成器配置
generator_type: Option<FieldGeneratorType>字段生成器类型
Implementations§
Source§impl FieldSchema
impl FieldSchema
Sourcepub fn with_generator_type(self, generator_type: FieldGeneratorType) -> Self
pub fn with_generator_type(self, generator_type: FieldGeneratorType) -> Self
设置字段生成器类型
Sourcepub fn with_constraints(self, constraints: FieldConstraints) -> Self
pub fn with_constraints(self, constraints: FieldConstraints) -> Self
设置字段约束
Sourcepub fn with_description(self, description: String) -> Self
pub fn with_description(self, description: String) -> Self
设置字段描述
Sourcepub fn with_generator_config(self, config: HashMap<String, Value>) -> Self
pub fn with_generator_config(self, config: HashMap<String, 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
Source§impl PartialEq for FieldSchema
impl PartialEq for FieldSchema
Source§impl Serialize for FieldSchema
impl Serialize for FieldSchema
impl StructuralPartialEq for FieldSchema
Auto Trait Implementations§
impl Freeze for FieldSchema
impl RefUnwindSafe for FieldSchema
impl Send for FieldSchema
impl Sync for FieldSchema
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more