pub enum DataType {
Show 16 variants
String {
max_length: Option<usize>,
},
Integer {
min: Option<i64>,
max: Option<i64>,
},
Float {
min: Option<f64>,
max: Option<f64>,
precision: Option<usize>,
},
Boolean,
DateTime {
format: Option<String>,
},
Date {
format: Option<String>,
},
Time {
format: Option<String>,
},
Uuid,
Email,
Phone {
country: Option<String>,
},
Url,
Json,
Array {
item_type: Box<DataType>,
min_items: Option<usize>,
max_items: Option<usize>,
},
Object {
fields: HashMap<String, FieldSchema>,
},
Enum {
values: Vec<String>,
},
Custom {
type_name: String,
generator: String,
},
}Expand description
数据类型
Variants§
String
字符串类型
Integer
整数类型
Float
浮点数类型
Boolean
布尔类型
DateTime
日期时间类型
Date
日期类型
Time
时间类型
Uuid
UUID类型
邮箱类型
Phone
电话号码类型
Url
URL类型
Json
JSON类型
Array
数组类型
Object
对象类型
Fields
§
fields: HashMap<String, FieldSchema>Enum
枚举类型
Custom
自定义类型
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataType
impl<'de> Deserialize<'de> for DataType
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
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
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