[][src]Module pgx::inoutfuncs

Helper trait for the #[derive(PostgresType)] proc macro for overriding custom Postgres type input/output functions.

The default implementations use serde_json to serialize a custom type to human-readable strings, and serde_cbor to serialize internally as a varlena * for storage on disk.

Traits

InOutFuncs

Functions

from_varlena_borrowed

Decode a borrowed Postgres varlena pointer from JSON into a Rust type instance

from_varlena_owned

Decode am owned Postgres varlena pointer from CBOR into a Rust type instance

to_varlena_borrowed

Encode a Rust type containing at least one borrowed value that is serde::Serialize into a Postgres varlena pointer as JSON

to_varlena_owned

Encode a Rust type containing only owned values that is serde::Serialize into a Postgres varlena pointer as CBOR