Skip to main content

Module types

Module types 

Source
Expand description

Converting between Rust values and PostgreSQL values.

RustPostgreSQL
boolboolean
i16, i32, i64smallint, integer, bigint (any of them, checked for range); oid
f32, f64real, double precision
&str, Stringtext, varchar, char(n), name; as parameters, any type the server can parse from text (uuid, numeric, date, json…); as results, any column this table does not list
&[u8], Vec<u8>bytea
SystemTimetimestamptz
Option<T>NULL or a value

Integers convert between the three integer types when the value fits, and fail with an error naming the parameter or column when it does not, so a conversion never loses anything silently.

Structs§

Type
A PostgreSQL type, identified by its OID.

Enums§

Encoded
How a parameter value was written by ToSql.
Format
The format a value arrived in.

Traits§

FromSql
A Rust value that a column can be read as, with Row::get.
ToSql
A Rust value that can be a statement parameter.