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

pub trait Encode<'q, DB: Database> {
#[must_use]    fn encode_by_ref(
        &self,
        buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer
    ) -> IsNull; #[must_use] fn encode(
        self,
        buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer
    ) -> IsNull
    where
        Self: Sized
, { ... }
fn produces(&self) -> Option<DB::TypeInfo> { ... }
fn size_hint(&self) -> usize { ... } }

Encode a single value to be sent to the database.

Required methods

#[must_use]fn encode_by_ref(
    &self,
    buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer
) -> IsNull
[src]

Writes the value of self into buf without moving self.

Where possible, make use of encode instead as it can take advantage of re-using memory.

Loading content...

Provided methods

#[must_use]fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull where
    Self: Sized
[src]

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

fn produces(&self) -> Option<DB::TypeInfo>[src]

fn size_hint(&self) -> usize[src]

Loading content...

Implementations on Foreign Types

impl<'q, T, DB: Database> Encode<'q, DB> for &T where
    T: Encode<'q, DB>, 
[src]

impl<'q, DB> Encode<'q, DB> for JsonValue where
    Self: Type<DB>,
    Json<&'a Self>: Encode<'q, DB>,
    DB: Database
[src]

impl<'q> Encode<'q, Any> for bool where
    bool: AnyEncode<'q>, 
[src]

impl<'q> Encode<'q, Any> for i32 where
    i32: AnyEncode<'q>, 
[src]

impl<'q> Encode<'q, Any> for i64 where
    i64: AnyEncode<'q>, 
[src]

impl<'q> Encode<'q, Any> for f32 where
    f32: AnyEncode<'q>, 
[src]

impl<'q> Encode<'q, Any> for f64 where
    f64: AnyEncode<'q>, 
[src]

impl<'q> Encode<'q, Any> for &'q str where
    &'q str: AnyEncode<'q>, 
[src]

impl<'q> Encode<'q, Any> for String where
    String: AnyEncode<'q>, 
[src]

impl<'q, T> Encode<'q, Any> for Option<T> where
    T: Encode<'q, Any> + Type<Any> + 'q, 
[src]

impl<'q, T> Encode<'q, Postgres> for Vec<T> where
    &'a [T]: Encode<'q, Postgres>,
    T: Encode<'q, Postgres>,
    Self: Type<Postgres>, 
[src]

impl<'q, T> Encode<'q, Postgres> for &[T] where
    T: Encode<'q, Postgres> + Type<Postgres>,
    Self: Type<Postgres>, 
[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 i8[src]

impl Encode<'_, Postgres> for i16[src]

impl Encode<'_, Postgres> for u32[src]

impl Encode<'_, Postgres> for i32[src]

impl Encode<'_, Postgres> for i64[src]

impl Encode<'_, Postgres> for Duration[src]

impl Encode<'_, Postgres> for Duration[src]

impl Encode<'_, Postgres> for Duration[src]

impl Encode<'_, Postgres> for &str[src]

impl Encode<'_, Postgres> for String[src]

impl<'q, T> Encode<'q, Postgres> for Option<T> where
    T: Encode<'q, Postgres> + Type<Postgres> + 'q, 
[src]

impl<'q> Encode<'q, Sqlite> for bool[src]

impl<'q> Encode<'q, Sqlite> for &'q [u8][src]

impl<'q> Encode<'q, Sqlite> for Vec<u8>[src]

impl<'q> Encode<'q, Sqlite> for f32[src]

impl<'q> Encode<'q, Sqlite> for f64[src]

impl<'q> Encode<'q, Sqlite> for i8[src]

impl<'q> Encode<'q, Sqlite> for i16[src]

impl<'q> Encode<'q, Sqlite> for i32[src]

impl<'q> Encode<'q, Sqlite> for i64[src]

impl<'q> Encode<'q, Sqlite> for &'q str[src]

impl<'q> Encode<'q, Sqlite> for String[src]

impl<'q> Encode<'q, Sqlite> for u8[src]

impl<'q> Encode<'q, Sqlite> for u16[src]

impl<'q> Encode<'q, Sqlite> for u32[src]

impl<'q> Encode<'q, Sqlite> for Hyphenated[src]

impl<'q, T> Encode<'q, Sqlite> for Option<T> where
    T: Encode<'q, Sqlite> + Type<Sqlite> + 'q, 
[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<'_, MySql> for Hyphenated[src]

impl<'q, T> Encode<'q, MySql> for Option<T> where
    T: Encode<'q, MySql> + Type<MySql> + 'q, 
[src]

impl Encode<'_, Mssql> for bool[src]

impl Encode<'_, Mssql> for f32[src]

impl Encode<'_, Mssql> for f64[src]

impl Encode<'_, Mssql> for i8[src]

impl Encode<'_, Mssql> for i16[src]

impl Encode<'_, Mssql> for i32[src]

impl Encode<'_, Mssql> for i64[src]

impl Encode<'_, Mssql> for &str[src]

impl Encode<'_, Mssql> for String[src]

impl<'q, T: 'q + Encode<'q, Mssql>> Encode<'q, Mssql> for Option<T>[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<'_, MySql> for BigDecimal[src]

impl Encode<'_, MySql> for Decimal[src]

impl Encode<'_, MySql> for Uuid[src]

impl Encode<'_, MySql> for Date[src]

impl Encode<'_, MySql> for OffsetDateTime[src]

impl Encode<'_, MySql> for PrimitiveDateTime[src]

impl Encode<'_, MySql> for Time[src]

impl Encode<'_, Postgres> for IpNetwork[src]

impl Encode<'_, Postgres> for PgInterval[src]

impl Encode<'_, Postgres> for PgMoney[src]

impl Encode<'_, Postgres> for PgTimeTz<NaiveTime, FixedOffset>[src]

impl Encode<'_, Postgres> for PgTimeTz<Time, UtcOffset>[src]

impl Encode<'_, Postgres> for NaiveDate[src]

impl Encode<'_, Postgres> for NaiveDateTime[src]

impl Encode<'_, Postgres> for NaiveTime[src]

impl Encode<'_, Postgres> for BigDecimal[src]

Panics

If this BigDecimal cannot be represented by PgNumeric.

impl Encode<'_, Postgres> for BitVec[src]

impl Encode<'_, Postgres> for Decimal[src]

Panics

If this Decimal cannot be represented by PgNumeric.

impl Encode<'_, Postgres> for Uuid[src]

impl Encode<'_, Postgres> for Date[src]

impl Encode<'_, Postgres> for OffsetDateTime[src]

impl Encode<'_, Postgres> for PrimitiveDateTime[src]

impl Encode<'_, Postgres> for Time[src]

impl Encode<'_, Sqlite> for NaiveDate[src]

impl Encode<'_, Sqlite> for NaiveDateTime[src]

impl Encode<'_, Sqlite> for NaiveTime[src]

impl<'q> Encode<'q, Sqlite> for Uuid[src]

impl<'q, T> Encode<'q, Postgres> for PgRange<T> where
    T: Encode<'q, Postgres>, 
[src]

impl<'q, T> Encode<'q, Postgres> for Json<T> where
    T: Serialize
[src]

impl<T> Encode<'_, MySql> for Json<T> where
    T: Serialize
[src]

impl<T> Encode<'_, Sqlite> for Json<T> where
    T: Serialize
[src]

impl<Tz: TimeZone> Encode<'_, Postgres> for DateTime<Tz>[src]

impl<Tz: TimeZone> Encode<'_, Sqlite> for DateTime<Tz> where
    Tz::Offset: Display
[src]

Loading content...