Skip to main content

InputDatumType

Trait InputDatumType 

Source
pub trait InputDatumType<'a, E>: Sized {
    // Required methods
    fn nullable() -> bool;
    fn try_from_result(
        res: Result<Datum<'a>, E>,
    ) -> Result<Self, Result<Datum<'a>, E>>;

    // Provided method
    fn try_from_iter(
        iter: &mut impl Iterator<Item = Result<Datum<'a>, E>>,
    ) -> Result<Self, Result<Option<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 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.

Provided Methods§

Source

fn try_from_iter( iter: &mut impl Iterator<Item = Result<Datum<'a>, E>>, ) -> Result<Self, Result<Option<Datum<'a>>, E>>

Try to convert a number of datums to a Result whose Ok variant is a native Rust type (Self) representing a number of datums obtained from the iterator.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

impl<'a, E> InputDatumType<'a, E> for OrderedDecimal<Numeric>

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

impl<'a, E, B: ToOwned + ?Sized> InputDatumType<'a, E> for Cow<'a, B>
where for<'b> B::Owned: InputDatumType<'b, E>, for<'b> &'b B: InputDatumType<'b, E>,

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

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

Source§

fn nullable() -> bool

Source§

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

Source§

fn try_from_iter( iter: &mut impl Iterator<Item = Result<Datum<'a>, E>>, ) -> Result<Self, Result<Option<Datum<'a>>, E>>

Source§

impl<'a, E, T0: InputDatumType<'a, E>> InputDatumType<'a, E> for (T0,)

Source§

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

Source§

fn try_from_iter( iter: &mut impl Iterator<Item = Result<Datum<'a>, E>>, ) -> Result<Self, Result<Option<Datum<'a>>, E>>

Source§

fn nullable() -> bool

Source§

impl<'a, E, T0: InputDatumType<'a, E>, T1: InputDatumType<'a, E>> InputDatumType<'a, E> for (T0, T1)

Source§

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

Source§

fn try_from_iter( iter: &mut impl Iterator<Item = Result<Datum<'a>, E>>, ) -> Result<Self, Result<Option<Datum<'a>>, E>>

Source§

fn nullable() -> bool

Source§

impl<'a, E, T0: InputDatumType<'a, E>, T1: InputDatumType<'a, E>, T2: InputDatumType<'a, E>> InputDatumType<'a, E> for (T0, T1, T2)

Source§

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

Source§

fn try_from_iter( iter: &mut impl Iterator<Item = Result<Datum<'a>, E>>, ) -> Result<Self, Result<Option<Datum<'a>>, E>>

Source§

fn nullable() -> bool

Source§

impl<'a, E, T0: InputDatumType<'a, E>, T1: InputDatumType<'a, E>, T2: InputDatumType<'a, E>, T3: InputDatumType<'a, E>> InputDatumType<'a, E> for (T0, T1, T2, T3)

Source§

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

Source§

fn try_from_iter( iter: &mut impl Iterator<Item = Result<Datum<'a>, E>>, ) -> Result<Self, Result<Option<Datum<'a>>, E>>

Source§

fn nullable() -> bool

Source§

impl<'a, E, T0: InputDatumType<'a, E>, T1: InputDatumType<'a, E>, T2: InputDatumType<'a, E>, T3: InputDatumType<'a, E>, T4: InputDatumType<'a, E>> InputDatumType<'a, E> for (T0, T1, T2, T3, T4)

Source§

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

Source§

fn try_from_iter( iter: &mut impl Iterator<Item = Result<Datum<'a>, E>>, ) -> Result<Self, Result<Option<Datum<'a>>, E>>

Source§

fn nullable() -> bool

Implementors§

Source§

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

Source§

impl<'a, E> InputDatumType<'a, E> for Array<'a>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<'a, E> InputDatumType<'a, E> for ArrayRustType<Cow<'a, str>>

Source§

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

Source§

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

Source§

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

Source§

impl<'a, E> InputDatumType<'a, E> for Int2Vector<'a>

Source§

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

Source§

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

Source§

impl<'a, E, B: InputDatumType<'a, E>> InputDatumType<'a, E> for ExcludeNull<B>