[][src]Trait sqlx_core::encode::Encode

pub trait Encode<DB: ?Sized> where
    DB: Database
{ fn encode(&self, buf: &mut Vec<u8>); fn encode_nullable(&self, buf: &mut Vec<u8>) -> IsNull { ... }
fn size_hint(&self) -> usize { ... } }

Encode a single value to be sent to the database.

Required methods

fn encode(&self, buf: &mut Vec<u8>)

Writes the value of self into buf in the expected format for the database.

Loading content...

Provided methods

fn encode_nullable(&self, buf: &mut Vec<u8>) -> IsNull

fn size_hint(&self) -> usize

Loading content...

Implementations on Foreign Types

impl<'_, T: ?Sized, DB> Encode<DB> for &'_ T where
    DB: Database + HasSqlType<T>,
    T: Encode<DB>, 
[src]

impl<T, DB> Encode<DB> for Option<T> where
    DB: Database + HasSqlType<T>,
    T: Encode<DB>, 
[src]

impl Encode<MySql> for bool[src]

impl Encode<MySql> for [u8][src]

impl Encode<MySql> for Vec<u8>[src]

impl Encode<MySql> for f32[src]

impl Encode<MySql> for f64[src]

impl Encode<MySql> for i8[src]

impl Encode<MySql> for i16[src]

impl Encode<MySql> for i32[src]

impl Encode<MySql> for i64[src]

impl Encode<MySql> for str[src]

impl Encode<MySql> for String[src]

impl Encode<MySql> for u8[src]

impl Encode<MySql> for u16[src]

impl Encode<MySql> for u32[src]

impl Encode<MySql> for u64[src]

impl Encode<Postgres> for bool[src]

impl Encode<Postgres> for [u8][src]

impl Encode<Postgres> for Vec<u8>[src]

impl Encode<Postgres> for f32[src]

impl Encode<Postgres> for f64[src]

impl Encode<Postgres> for i16[src]

impl Encode<Postgres> for i32[src]

impl Encode<Postgres> for i64[src]

impl Encode<Postgres> for str[src]

impl Encode<Postgres> for String[src]

Loading content...

Implementors

impl Encode<MySql> for DateTime<Utc>[src]

impl Encode<MySql> for NaiveDate[src]

impl Encode<MySql> for NaiveDateTime[src]

impl Encode<MySql> for NaiveTime[src]

impl Encode<Postgres> for NaiveDate[src]

impl Encode<Postgres> for NaiveDateTime[src]

impl Encode<Postgres> for NaiveTime[src]

impl Encode<Postgres> for Uuid[src]

impl<Tz: TimeZone> Encode<Postgres> for DateTime<Tz> where
    Tz::Offset: Copy
[src]

Loading content...