[][src]Enum noria::DataType

pub enum DataType {
    None,
    Int(i32),
    UnsignedInt(u32),
    BigInt(i64),
    UnsignedBigInt(u64),
    Real(i64i32),
    Text(ArcCStr),
    TinyText([u8; 15]),
    Timestamp(NaiveDateTime),
}

The main type used for user data throughout the codebase.

Having this be an enum allows for our code to be agnostic about the types of user data except when type information is specifically necessary.

Note that cloning a DataType using the Clone trait is possible, but may result in cache contention on the reference counts for de-duplicated strings. Use DataType::deep_clone to clone the value of a DataType without danger of contention.

Variants

None

An empty value.

Int(i32)

A signed 32-bit numeric value.

UnsignedInt(u32)

An unsigned 32-bit numeric value.

BigInt(i64)

A signed 64-bit numeric value.

UnsignedBigInt(u64)

An unsigned signed 64-bit numeric value.

Real(i64i32)

A fixed point real value. The first field is the integer part, while the second is the fractional and must be between -999999999 and 999999999.

Text(ArcCStr)

A reference-counted string-like value.

TinyText([u8; 15])

A tiny string that fits in a pointer

Timestamp(NaiveDateTime)

A timestamp for date/time types.

Implementations

impl DataType[src]

pub fn deep_clone(&self) -> Self[src]

Clone the value contained within this DataType.

This method crucially does not cause cache-line conflicts with the underlying data-store (i.e., the owner of self), at the cost of requiring additional allocation and copying.

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

Checks if this value is DataType::None.

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

Checks if this value is of an integral data type (i.e., can be converted into integral types).

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

Checks if this value is of a real data type (i.e., can be converted into f64).

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

Checks if this value is of a string data type (i.e., can be converted into String and &str).

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

Checks if this values is of a timestamp data type.

Trait Implementations

impl<'a, 'b> Add<&'b DataType> for &'a DataType[src]

type Output = DataType

The resulting type after applying the + operator.

impl Clone for DataType[src]

impl Debug for DataType[src]

impl<'de> Deserialize<'de> for DataType[src]

impl Display for DataType[src]

impl<'a, 'b> Div<&'b DataType> for &'a DataType[src]

type Output = DataType

The resulting type after applying the / operator.

impl Eq for DataType[src]

impl<'_> From<&'_ DataType> for i128[src]

impl<'_> From<&'_ DataType> for i64[src]

impl<'_> From<&'_ DataType> for u64[src]

impl<'_> From<&'_ DataType> for i32[src]

impl<'_> From<&'_ DataType> for u32[src]

impl<'_> From<&'_ DataType> for f64[src]

impl<'a> From<&'a DataType> for DataType[src]

impl<'a> From<&'a DataType> for &'a str[src]

impl<'a> From<&'a Literal> for DataType[src]

impl<'a> From<&'a str> for DataType[src]

impl From<DataType> for i128[src]

impl From<DataType> for i64[src]

impl From<DataType> for u64[src]

impl From<DataType> for i32[src]

impl From<DataType> for u32[src]

impl From<DataType> for f64[src]

impl From<Literal> for DataType[src]

impl From<NaiveDateTime> for DataType[src]

impl<T> From<Option<T>> for DataType where
    DataType: From<T>, 
[src]

impl From<String> for DataType[src]

impl From<f32> for DataType[src]

impl From<f64> for DataType[src]

impl From<i128> for DataType[src]

impl From<i32> for DataType[src]

impl From<i64> for DataType[src]

impl From<u32> for DataType[src]

impl From<u64> for DataType[src]

impl From<usize> for DataType[src]

impl Hash for DataType[src]

impl<'a, 'b> Mul<&'b DataType> for &'a DataType[src]

type Output = DataType

The resulting type after applying the * operator.

impl Ord for DataType[src]

impl PartialEq<DataType> for DataType[src]

impl PartialOrd<DataType> for DataType[src]

impl Serialize for DataType[src]

impl StructuralEq for DataType[src]

impl<'a, 'b> Sub<&'b DataType> for &'a DataType[src]

type Output = DataType

The resulting type after applying the - operator.

impl<'a> TryFrom<&'a [u8]> for DataType[src]

type Error = &'static str

The type returned in the event of a conversion error.

impl TryFrom<Value> for DataType[src]

type Error = &'static str

The type returned in the event of a conversion error.

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[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>, 

impl<T> WithSubscriber for T[src]