Trait mz_repr::scalar::DatumType

source ·
pub trait DatumType<'a, E>: Sized {
    // Required methods
    fn nullable() -> bool;
    fn fallible() -> bool;
    fn try_from_result(
        res: Result<Datum<'a>, E>,
    ) -> Result<Self, Result<Datum<'a>, E>>;
    fn into_result(self, temp_storage: &'a RowArena) -> Result<Datum<'a>, E>;
}
Expand description

A bridge between native Rust types and SQL runtime types represented in Datums

Required Methods§

source

fn nullable() -> bool

Whether this Rust type can represent NULL values

source

fn fallible() -> bool

Whether this Rust type can represent errors

source

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

Try to convert a Result whose Ok variant is a Datum into this native Rust type (Self). If it fails the error variant will contain the original result.

source

fn into_result(self, temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

Convert this Rust type into a Result containing a Datum, or an error

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, E> DatumType<'a, E> for &'a str

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for &'a [u8]

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for bool

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for f32

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for f64

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for i16

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for i32

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for i64

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for u16

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for u32

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for u64

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for NaiveTime

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for Uuid

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, _temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for String

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E> DatumType<'a, E> for Vec<u8>

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E, B: DatumType<'a, E>> DatumType<'a, E> for Option<B>

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

source§

impl<'a, E, B: DatumType<'a, E>> DatumType<'a, E> for Result<B, E>

source§

fn nullable() -> bool

source§

fn fallible() -> bool

source§

fn try_from_result( res: Result<Datum<'a>, E>, ) -> Result<Self, Result<Datum<'a>, E>>

source§

fn into_result(self, temp_storage: &'a RowArena) -> Result<Datum<'a>, E>

Implementors§

source§

impl<'a, E> DatumType<'a, E> for Datum<'a>

source§

impl<'a, E> DatumType<'a, E> for Char<&'a str>

source§

impl<'a, E> DatumType<'a, E> for Char<String>

source§

impl<'a, E> DatumType<'a, E> for Date

source§

impl<'a, E> DatumType<'a, E> for Interval

source§

impl<'a, E> DatumType<'a, E> for Jsonb

source§

impl<'a, E> DatumType<'a, E> for JsonbRef<'a>

source§

impl<'a, E> DatumType<'a, E> for AclItem

source§

impl<'a, E> DatumType<'a, E> for MzAclItem

source§

impl<'a, E> DatumType<'a, E> for PgLegacyName<&'a str>

source§

impl<'a, E> DatumType<'a, E> for PgLegacyName<String>

source§

impl<'a, E> DatumType<'a, E> for Range<Datum<'a>>

source§

impl<'a, E> DatumType<'a, E> for Range<DatumNested<'a>>

source§

impl<'a, E> DatumType<'a, E> for Oid

source§

impl<'a, E> DatumType<'a, E> for PgLegacyChar

source§

impl<'a, E> DatumType<'a, E> for RegClass

source§

impl<'a, E> DatumType<'a, E> for RegProc

source§

impl<'a, E> DatumType<'a, E> for RegType

source§

impl<'a, E> DatumType<'a, E> for CheckedTimestamp<DateTime<Utc>>

source§

impl<'a, E> DatumType<'a, E> for CheckedTimestamp<NaiveDateTime>

source§

impl<'a, E> DatumType<'a, E> for VarChar<&'a str>

source§

impl<'a, E> DatumType<'a, E> for VarChar<String>

source§

impl<'a, E> DatumType<'a, E> for DatumList<'a>

source§

impl<'a, E> DatumType<'a, E> for DatumMap<'a>

source§

impl<'a, E> DatumType<'a, E> for Timestamp

source§

impl<'a, E> DatumType<'a, E> for ArrayRustType<String>

source§

impl<'a, E> DatumType<'a, E> for Numeric