Trait sqlx::Encode [−][src]
pub trait Encode<'q, DB> where
DB: Database, {
fn encode_by_ref(
&self,
buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer
) -> IsNull;
fn encode(
self,
buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer
) -> IsNull { ... }
fn produces(&self) -> Option<<DB as Database>::TypeInfo> { ... }
fn size_hint(&self) -> usize { ... }
}
Expand description
Encode a single value to be sent to the database.
Required methods
fn encode_by_ref(
&self,
buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer
) -> IsNull
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.
Provided methods
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull
fn encode(self, buf: &mut <DB as HasArguments<'q>>::ArgumentBuffer) -> IsNull
Writes the value of self
into buf
in the expected format for the database.
Implementations on Foreign Types
pub fn encode_by_ref(
&self,
buf: &mut <Postgres as HasArguments<'q>>::ArgumentBuffer
) -> IsNull
Implementors
Note: assumes the connection’s time_zone
is set to +00:00
(UTC).
Note: assumes the connection’s time_zone
is set to +00:00
(UTC).
Panics
If this BigDecimal
cannot be represented by PgNumeric
.
Panics
If this Decimal
cannot be represented by PgNumeric
.