[][src]Trait elephantry::ToSql

pub trait ToSql {
    fn ty(&self) -> Type;
fn to_sql(&self) -> Result<Option<Vec<u8>>>; fn format(&self) -> Format { ... }
fn error(&self, rust_type: &str, message: Option<&String>) -> Error { ... } }

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

Required methods

fn ty(&self) -> Type

The corresponding SQL type

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

Convert the value

Loading content...

Provided methods

fn format(&self) -> Format

fn error(&self, rust_type: &str, message: Option<&String>) -> Error

Loading content...

Implementations on Foreign Types

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

impl<T: ToSql> ToSql for RangeInclusive<T>[src]

impl ToSql for bool[src]

impl ToSql for f32[src]

impl ToSql for f64[src]

impl<'_> ToSql for &'_ str[src]

impl ToSql for char[src]

impl ToSql for String[src]

impl ToSql for i16[src]

impl ToSql for i32[src]

impl ToSql for i64[src]

impl ToSql for u32[src]

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

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

Loading content...

Implementors

impl ToSql for Bytea[src]

impl ToSql for Hstore[src]

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

Loading content...