[][src]Trait pgx::datum::IntoDatum

pub trait IntoDatum {
    fn into_datum(self) -> Option<Datum>;
fn type_oid() -> Oid; fn array_type_oid() -> Oid { ... } }

Convert a Rust type into a pg_sys::Datum.

Default implementations are provided for the common Rust types.

If implementing this, also implement FromDatum for the reverse conversion.

Note that any conversions that need to allocate memory (ie, for a varlena * representation of a Rust type, that memory must be allocated within a [PgMemoryContext]

Required methods

fn into_datum(self) -> Option<Datum>

fn type_oid() -> Oid

Loading content...

Provided methods

Loading content...

Implementations on Foreign Types

impl<T> IntoDatum for Vec<T> where
    T: IntoDatum
[src]

impl IntoDatum for BOX[src]

impl IntoDatum for Point[src]

impl<T> IntoDatum for Option<T> where
    T: IntoDatum
[src]

for supporting NULL as the None value of an Option

impl IntoDatum for bool[src]

for bool

impl IntoDatum for i8[src]

for "char"

impl IntoDatum for i16[src]

for smallint

impl IntoDatum for i32[src]

for integer

impl IntoDatum for u32[src]

for oid

impl IntoDatum for i64[src]

for bigint

impl IntoDatum for f32[src]

for real

impl IntoDatum for f64[src]

for double precision

impl<'a> IntoDatum for &'a str[src]

for text, varchar

impl IntoDatum for String[src]

impl<'_> IntoDatum for &'_ String[src]

impl IntoDatum for char[src]

impl<'a> IntoDatum for &'a CStr[src]

for cstring

Safety

The &CStr better be allocated by Postgres

impl<'a> IntoDatum for &'a [u8][src]

for bytea

impl IntoDatum for Vec<u8>[src]

impl IntoDatum for ()[src]

for NULL -- always converts to None

impl IntoDatum for Datum[src]

impl IntoDatum for ItemPointerData[src]

impl<A, B> IntoDatum for (Option<A>, Option<B>) where
    A: IntoDatum,
    B: IntoDatum
[src]

impl<A, B, C> IntoDatum for (Option<A>, Option<B>, Option<C>) where
    A: IntoDatum,
    B: IntoDatum,
    C: IntoDatum
[src]

Loading content...

Implementors

impl IntoDatum for PgOid[src]

impl IntoDatum for AnyArray[src]

impl IntoDatum for AnyElement[src]

impl IntoDatum for Date[src]

impl IntoDatum for Inet[src]

impl IntoDatum for Json[src]

for json

impl IntoDatum for JsonB[src]

for jsonb

impl IntoDatum for JsonString[src]

for jsonstring

impl IntoDatum for Numeric[src]

impl IntoDatum for Time[src]

impl IntoDatum for TimeWithTimeZone[src]

impl IntoDatum for Timestamp[src]

impl IntoDatum for TimestampWithTimeZone[src]

impl IntoDatum for PgRelation[src]

impl<'a> IntoDatum for DetoastedVarlenA<'a>[src]

impl<'a> IntoDatum for OwnedVarlenA<'a>[src]

impl<T> IntoDatum for PgBox<T>[src]

for user types

Loading content...