[−][src]Enum restq::DataType
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
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]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'_> Into<DataType> for &'_ DataType
[src]
the corresponding sql type for this data type
impl PartialEq<DataType> for DataType
[src]
pub fn eq(&self, other: &DataType) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for DataType
[src]
impl StructuralPartialEq for DataType
[src]
Auto Trait Implementations
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,