[][src]Enum restq::DataType

pub enum DataType {
    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,
}

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

bool

S8

8 bit serial integer

S16

16 bit serial integer

S32

32 bit serial integer

S64

64 bit serial integer

F32

f32

F64

f64

U8

u8

U16

u16

U32

u32

U64

u64

I8

i8

I16

i16

I32

i32

I64

i64

Uuid

Uuid, no default specified

UuidRand

Uuid with random as the default

UuidSlug

create a new uuid and generate a url friendly base64 using blob_uuid

Local

local time with now as the default

Utc

Utc time with now as the default

Text

text/strings, generic text, no interpretation

Ident

A valid identifier string defined by begining of alpha_or_underscore character and optionally followed by alphnumeric characters

Url

A valid url

Json

json type

Bytes

bytes

Implementations

impl DataType[src]

pub fn all() -> Vec<DataType>[src]

returns all the supported data types

pub fn is_numeric(&self) -> bool[src]

returns true if type is numeric or not

pub fn is_autogenerate(&self) -> bool[src]

Trait Implementations

impl Clone for DataType[src]

impl Debug for DataType[src]

impl Display for DataType[src]

impl Eq for DataType[src]

impl Hash for DataType[src]

impl<'_> Into<DataType> for &'_ DataType[src]

the corresponding sql type for this data type

impl PartialEq<DataType> for DataType[src]

impl StructuralEq for DataType[src]

impl StructuralPartialEq for DataType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,