[][src]Trait elephantry::Composite

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

Trait to convert rust struct to composite type.

Required methods

pub fn name() -> &'static str[src]

Composite type name.

pub fn to_vec(&self) -> Vec<&dyn ToSql>[src]

Convert struct to a vector of SQL value.

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

Create a new struct from SQL result in text format.

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

Create a new struct from SQL result in binary format.

Loading content...

Provided methods

pub fn to_sql(&self) -> Result<Option<Vec<u8>>>[src]

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

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

Loading content...

Implementors

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

Loading content...