Enum restq::DataType [−][src]
pub enum DataType {}Show 25 variants
Bool, S8, S16, S32, S64, F32, F64, U8, U16, U32, U64, I8, I16, I32, I64, Uuid, UuidRand, UuidSlug, Local, Utc, Text, Ident, Url, Json, Bytes,
Expand description
restq supports comprehensive data types
based on rust and postgresql type, combined together
format: <data_type>?
? - indicates it is optional, nullable in database context
example:
text? - nullable text
text(8..) - text with at least 8 characters long
text(..255) - text must not be more than 255 characters long.
u32(1) - u32 with default value of 1
u32(>10) - check value should be greater than 10
u32(10<column<=20) - check the value should be greater than 10 and less than or equal to 20
u32(<discount) - check value should be lesser than discount
column
f32(0.0) - f32 with 0.0 as the default value
Variants
bool
8 bit serial integer
16 bit serial integer
32 bit serial integer
64 bit serial integer
f32
f64
u8
u16
u32
u64
i8
i16
i32
i64
Uuid, no default specified
Uuid with random as the default
create a new uuid and generate a url friendly base64 using blob_uuid
local time with now as the default
Utc time with now as the default
text/strings, generic text, no interpretation
A valid identifier string defined by begining of alpha_or_underscore character and optionally followed by alphnumeric characters
A valid url
json type
bytes
Implementations
returns true if type is numeric or not
Trait Implementations
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
the corresponding sql type for this data type
Auto Trait Implementations
impl RefUnwindSafe for DataType
impl UnwindSafe for DataType
Blanket Implementations
Mutably borrows from an owned value. Read more