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

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

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

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

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

fn size_hint(&self) -> usize

Loading content...

Implementations on Foreign Types

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

Loading content...

Implementors

Loading content...