pub trait Encode<'q, DB>
where DB: Database,
{ // Required method fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>; // Provided methods fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>> where Self: Sized { ... } 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 Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

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 Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where Self: Sized,

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

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

fn size_hint(&self) -> usize

Implementations on Foreign Types§

§

impl Encode<'_, MySql> for &str

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for &[u8]

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for Cow<'_, str>

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for IpAddr

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for bool

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for f32

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for f64

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for i8

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for i16

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for i32

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for i64

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for u8

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for u16

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for u32

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for u64

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for Box<str>

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for Box<[u8]>

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for String

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for Vec<u8>

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for Ipv4Addr

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, MySql> for Ipv6Addr

§

fn encode_by_ref( &self, buf: &mut Vec<u8>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for &str

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

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

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for Cow<'_, str>

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for bool

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for f32

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for f64

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for i8

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for i16

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for i32

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for i64

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for Box<str>

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for Box<[u8]>

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for String

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for Vec<u8>

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Postgres> for Duration

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn size_hint(&self) -> usize

§

impl Encode<'_, Postgres> for TimeDelta

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn size_hint(&self) -> usize

§

impl Encode<'_, Postgres> for Duration

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn size_hint(&self) -> usize

§

impl Encode<'_, Sqlite> for Box<str>

§

fn encode( self, args: &mut Vec<SqliteArgumentValue<'_>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'_>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl Encode<'_, Sqlite> for Box<[u8]>

§

fn encode( self, args: &mut Vec<SqliteArgumentValue<'_>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'_>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'a> Encode<'a, Any> for &'a str

§

fn encode( self, buf: &mut <Any as Database>::ArgumentBuffer<'a>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where &'a str: Sized,

§

fn encode_by_ref( &self, buf: &mut <Any as Database>::ArgumentBuffer<'a>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

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

§

fn encode_by_ref( &self, buf: &mut <Any as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Any> for bool

§

fn encode_by_ref( &self, buf: &mut <Any as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Any> for f32

§

fn encode_by_ref( &self, buf: &mut AnyArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Any> for f64

§

fn encode_by_ref( &self, buf: &mut <Any as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Any> for i16

§

fn encode_by_ref( &self, buf: &mut <Any as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Any> for i32

§

fn encode_by_ref( &self, buf: &mut <Any as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Any> for i64

§

fn encode_by_ref( &self, buf: &mut <Any as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Any> for String

§

fn encode_by_ref( &self, buf: &mut <Any as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Any> for Vec<u8>

§

fn encode_by_ref( &self, buf: &mut <Any as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for &'q str

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

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

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for Cow<'q, str>

§

fn encode( self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for bool

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for f32

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for f64

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for i8

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for i16

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for i32

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for i64

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for u8

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for u16

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for u32

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for String

§

fn encode( self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q> Encode<'q, Sqlite> for Vec<u8>

§

fn encode( self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode_by_ref( &self, args: &mut Vec<SqliteArgumentValue<'q>>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q, DB> Encode<'q, DB> for NonZero<i8>
where DB: Database, i8: Encode<'q, DB>,

§

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<i8>: Sized,

§

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

§

impl<'q, DB> Encode<'q, DB> for NonZero<i16>
where DB: Database, i16: Encode<'q, DB>,

§

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<i16>: Sized,

§

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

§

impl<'q, DB> Encode<'q, DB> for NonZero<i32>
where DB: Database, i32: Encode<'q, DB>,

§

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<i32>: Sized,

§

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

§

impl<'q, DB> Encode<'q, DB> for NonZero<i64>
where DB: Database, i64: Encode<'q, DB>,

§

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<i64>: Sized,

§

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

§

impl<'q, DB> Encode<'q, DB> for NonZero<u8>
where DB: Database, u8: Encode<'q, DB>,

§

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<u8>: Sized,

§

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

§

impl<'q, DB> Encode<'q, DB> for NonZero<u16>
where DB: Database, u16: Encode<'q, DB>,

§

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<u16>: Sized,

§

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

§

impl<'q, DB> Encode<'q, DB> for NonZero<u32>
where DB: Database, u32: Encode<'q, DB>,

§

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<u32>: Sized,

§

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

§

impl<'q, DB> Encode<'q, DB> for NonZero<u64>
where DB: Database, u64: Encode<'q, DB>,

§

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>
where NonZero<u64>: Sized,

§

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

§

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

§

fn encode_by_ref( &self, buf: &mut AnyArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

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

§

fn produces(&self) -> Option<<MySql as Database>::TypeInfo>

§

fn encode( self, buf: &mut <MySql as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode_by_ref( &self, buf: &mut <MySql as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn size_hint(&self) -> usize

§

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

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

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

§

fn produces(&self) -> Option<<Postgres as Database>::TypeInfo>

§

fn encode( self, buf: &mut <Postgres as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode_by_ref( &self, buf: &mut <Postgres as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn size_hint(&self) -> usize

§

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

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<'q, T> Encode<'q, Sqlite> for Option<T>
where T: Encode<'q, Sqlite> + Type<Sqlite> + 'q,

§

fn produces(&self) -> Option<<Sqlite as Database>::TypeInfo>

§

fn encode( self, buf: &mut <Sqlite as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode_by_ref( &self, buf: &mut <Sqlite as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn size_hint(&self) -> usize

§

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

§

fn encode( self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

fn encode_by_ref( &self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

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

§

fn size_hint(&self) -> usize

§

impl<'q, T, const N: usize> Encode<'q, Postgres> for [T; N]
where &'a [T]: for<'a> Encode<'q, Postgres>, T: Encode<'q, Postgres>,

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

§

impl<const N: usize> Encode<'_, Postgres> for [u8; N]

§

fn encode_by_ref( &self, buf: &mut PgArgumentBuffer, ) -> Result<IsNull, Box<dyn Error + Send + Sync>>

Implementors§

§

impl Encode<'_, MySql> for BigDecimal

§

impl Encode<'_, MySql> for NaiveDate

§

impl Encode<'_, MySql> for NaiveDateTime

§

impl Encode<'_, MySql> for Decimal

§

impl Encode<'_, MySql> for NaiveTime

§

impl Encode<'_, MySql> for Date

§

impl Encode<'_, MySql> for PrimitiveDateTime

§

impl Encode<'_, MySql> for OffsetDateTime

§

impl Encode<'_, MySql> for Time

§

impl Encode<'_, MySql> for Uuid

§

impl Encode<'_, MySql> for DateTime<Local>

Note: assumes the connection’s time_zone is set to +00:00 (UTC).

§

impl Encode<'_, MySql> for DateTime<Utc>

Note: assumes the connection’s time_zone is set to +00:00 (UTC).

§

impl Encode<'_, MySql> for Hyphenated

§

impl Encode<'_, MySql> for Simple

§

impl Encode<'_, Postgres> for BigDecimal

§Note: BigDecimal Has a Larger Range than NUMERIC

BigDecimal can represent values with a far, far greater range than the NUMERIC type in Postgres can.

NUMERIC is limited to 131,072 digits before the decimal point, and 16,384 digits after it. See Section 8.1, Numeric Types of the Postgres manual for details.

Meanwhile, BigDecimal can theoretically represent a value with an arbitrary number of decimal digits, albeit with a maximum of 263 significant figures.

Because encoding in the current API design must be infallible, when attempting to encode a BigDecimal that cannot fit in the wire representation of NUMERIC, SQLx may instead encode a sentinel value that falls outside the allowed range but is still representable.

This will cause the query to return a DatabaseError with code 22P03 (invalid_binary_representation) and the error message invalid scale in external "numeric" value (though this may be subject to change).

However, BigDecimal should be able to decode any NUMERIC value except NaN, for which it has no representation.

§

impl Encode<'_, Postgres> for NaiveDate

§

impl Encode<'_, Postgres> for NaiveDateTime

§

impl Encode<'_, Postgres> for Decimal

§

impl Encode<'_, Postgres> for NaiveTime

§

impl Encode<'_, Postgres> for Date

§

impl Encode<'_, Postgres> for PrimitiveDateTime

§

impl Encode<'_, Postgres> for OffsetDateTime

§

impl Encode<'_, Postgres> for Time

§

impl Encode<'_, Postgres> for Uuid

§

impl Encode<'_, Postgres> for Oid

§

impl Encode<'_, Postgres> for PgCiText

§

impl Encode<'_, Postgres> for PgHstore

§

impl Encode<'_, Postgres> for PgInterval

§

impl Encode<'_, Postgres> for PgLQuery

§

impl Encode<'_, Postgres> for PgLTree

§

impl Encode<'_, Postgres> for PgMoney

§

impl Encode<'_, Postgres> for PgTimeTz

§

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

§

impl Encode<'_, Sqlite> for NaiveDate

§

impl Encode<'_, Sqlite> for NaiveDateTime

§

impl Encode<'_, Sqlite> for NaiveTime

§

impl Encode<'_, Sqlite> for Date

§

impl Encode<'_, Sqlite> for PrimitiveDateTime

§

impl Encode<'_, Sqlite> for OffsetDateTime

§

impl Encode<'_, Sqlite> for Time

§

impl<'q> Encode<'q, MySql> for MySqlTime

§

impl<'q> Encode<'q, Postgres> for PgCube

§

impl<'q> Encode<'q, Sqlite> for Uuid

§

impl<'q> Encode<'q, Sqlite> for Hyphenated

§

impl<'q> Encode<'q, Sqlite> for Simple

§

impl<'q, DB> Encode<'q, DB> for Value
where Json<&'a Value>: for<'a> Encode<'q, DB>, DB: Database,

§

impl<'q, T> Encode<'q, MySql> for Text<T>
where T: Display,

§

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

§

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

§

impl<'q, T> Encode<'q, Postgres> for Text<T>
where T: Display,

§

impl<'q, T> Encode<'q, Sqlite> for Text<T>
where T: Display,

§

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

§

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

§

impl<Tz> Encode<'_, Postgres> for DateTime<Tz>
where Tz: TimeZone,

§

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