[][src]Trait elephantry::FromSql

pub trait FromSql: Sized {
    fn from_binary(ty: &Type, raw: Option<&[u8]>) -> Result<Self>;
fn from_text(ty: &Type, raw: Option<&str>) -> Result<Self>; fn from_sql(ty: &Type, format: Format, raw: Option<&[u8]>) -> Result<Self> { ... }
fn error<T: Debug>(pg_type: &Type, rust_type: &str, raw: T) -> Error { ... } }

Trait to allow a rust type to be translated form a SQL value.

Required methods

fn from_binary(ty: &Type, raw: Option<&[u8]>) -> Result<Self>

Create a new struct from the binary representation.

See the postgresql adt module source code, mainly *_send functions.

fn from_text(ty: &Type, raw: Option<&str>) -> Result<Self>

Create a new struct from the text representation.

Loading content...

Provided methods

fn from_sql(ty: &Type, format: Format, raw: Option<&[u8]>) -> Result<Self>

Create a new struct from SQL value.

fn error<T: Debug>(pg_type: &Type, rust_type: &str, raw: T) -> Error

Loading content...

Implementations on Foreign Types

impl FromSql for f32[src]

impl FromSql for f64[src]

impl FromSql for i16[src]

impl FromSql for i32[src]

impl FromSql for i64[src]

impl FromSql for u32[src]

impl FromSql for usize[src]

impl FromSql for bool[src]

impl<T: FromSql> FromSql for Option<T>[src]

impl FromSql for char[src]

impl FromSql for String[src]

impl<T: FromSql> FromSql for Vec<T>[src]

impl<T: FromSql> FromSql for Range<T>[src]

Loading content...

Implementors

impl FromSql for Bytea[src]

impl FromSql for Hstore[src]

impl<C: Composite> FromSql for C[src]

impl<T: FromSql> FromSql for Array<T>[src]

Loading content...