[][src]Trait elephantry::Composite

pub trait Composite {
    fn name() -> &'static str;
fn to_vec(&self) -> Vec<&dyn ToSql>;
fn from_text_values(ty: &Type, values: &[Option<&str>]) -> Result<Box<Self>>;
fn from_binary_values(
        ty: &Type,
        values: &[Option<&[u8]>]
    ) -> Result<Box<Self>>; fn to_sql(&self) -> Result<Option<Vec<u8>>> { ... }
fn from_binary(ty: &Type, raw: Option<&[u8]>) -> Result<Box<Self>> { ... }
fn from_text(ty: &Type, raw: Option<&str>) -> Result<Box<Self>> { ... } }

Trait to convert rust struct to composite type.

Required methods

fn name() -> &'static str

Composite type name.

fn to_vec(&self) -> Vec<&dyn ToSql>

Convert struct to a vector of SQL value.

fn from_text_values(ty: &Type, values: &[Option<&str>]) -> Result<Box<Self>>

Create a new struct from SQL result in text format.

fn from_binary_values(ty: &Type, values: &[Option<&[u8]>]) -> Result<Box<Self>>

Create a new struct from SQL result in binary format.

Loading content...

Provided methods

fn to_sql(&self) -> Result<Option<Vec<u8>>>

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

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

Loading content...

Implementors

impl<E: Enum> Composite for E[src]

Loading content...