Trait postgres::types::ToSql

pub trait ToSql: Debug {
    // Required methods
    fn to_sql(
        &self,
        ty: &Type,
        out: &mut BytesMut
    ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>
       where Self: Sized;
    fn accepts(ty: &Type) -> bool
       where Self: Sized;
    fn to_sql_checked(
        &self,
        ty: &Type,
        out: &mut BytesMut
    ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>;

    // Provided method
    fn encode_format(&self, _ty: &Type) -> Format { ... }
}
Expand description

A trait for types that can be converted into Postgres values.

Types

The following implementations are provided by this crate, along with the corresponding Postgres types:

Rust typePostgres type(s)
boolBOOL
i8“char”
i16SMALLINT, SMALLSERIAL
i32INT, SERIAL
u32OID
i64BIGINT, BIGSERIAL
f32REAL
f64DOUBLE PRECISION
&str/StringVARCHAR, CHAR(n), TEXT, CITEXT, NAME
LTREE, LQUERY, LTXTQUERY
&[u8]/Vec<u8>/[u8; N]BYTEA
HashMap<String, Option<String>>HSTORE
SystemTimeTIMESTAMP, TIMESTAMP WITH TIME ZONE
IpAddrINET

In addition, some implementations are provided for types in third party crates. These are disabled by default; to opt into one of these implementations, activate the Cargo feature corresponding to the crate’s name prefixed by with-. For example, the with-serde_json-1 feature enables the implementation for the serde_json::Value type.

Rust typePostgres type(s)
chrono::NaiveDateTimeTIMESTAMP
chrono::DateTime<Utc>TIMESTAMP WITH TIME ZONE
chrono::DateTime<Local>TIMESTAMP WITH TIME ZONE
chrono::DateTime<FixedOffset>TIMESTAMP WITH TIME ZONE
chrono::NaiveDateDATE
chrono::NaiveTimeTIME
time::PrimitiveDateTimeTIMESTAMP
time::OffsetDateTimeTIMESTAMP WITH TIME ZONE
time::DateDATE
time::TimeTIME
eui48::MacAddressMACADDR
geo_types::Point<f64>POINT
geo_types::Rect<f64>BOX
geo_types::LineString<f64>PATH
serde_json::ValueJSON, JSONB
uuid::UuidUUID
bit_vec::BitVecBIT, VARBIT
eui48::MacAddressMACADDR

Nullability

In addition to the types listed above, ToSql is implemented for Option<T> where T implements ToSql. An Option<T> represents a nullable Postgres value.

Arrays

ToSql is implemented for [u8; N], Vec<T>, &[T], Box<[T]> and [T; N] where T implements ToSql and N is const usize, and corresponds to one-dimensional Postgres arrays with an index offset of 1.

Note: the impl for arrays only exist when the Cargo feature array-impls is enabled.

Required Methods§

fn to_sql( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>where Self: Sized,

Converts the value of self into the binary format of the specified Postgres Type, appending it to out.

The caller of this method is responsible for ensuring that this type is compatible with the Postgres Type.

The return value indicates if this value should be represented as NULL. If this is the case, implementations must not write anything to out.

fn accepts(ty: &Type) -> boolwhere Self: Sized,

Determines if a value of this type can be converted to the specified Postgres Type.

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

An adaptor method used internally by Rust-Postgres.

All implementations of this method should be generated by the to_sql_checked!() macro.

Provided Methods§

fn encode_format(&self, _ty: &Type) -> Format

Specify the encode format

Trait Implementations§

§

impl BorrowToSql for &(dyn ToSql + Sync)

In async contexts it is sometimes necessary to have the additional Sync requirement on parameters for queries since this enables the resulting Futures to be Send, hence usable in, e.g., tokio::spawn. This instance is provided for those cases.

§

fn borrow_to_sql(&self) -> &dyn ToSql

Returns a reference to self as a ToSql trait object.
§

impl BorrowToSql for &dyn ToSql

§

fn borrow_to_sql(&self) -> &dyn ToSql

Returns a reference to self as a ToSql trait object.
§

impl<'a> BorrowToSql for Box<dyn ToSql + Sync + 'a, Global>

§

fn borrow_to_sql(&self) -> &dyn ToSql

Returns a reference to self as a ToSql trait object.
§

impl<'a> BorrowToSql for Box<dyn ToSql + Sync + Send + 'a, Global>

§

fn borrow_to_sql(&self) -> &dyn ToSql

Returns a reference to self as a ToSql trait object.

Implementations on Foreign Types§

§

impl ToSql for Date

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<T> ToSql for Option<T>where T: ToSql,

§

fn to_sql( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn encode_format(&self, ty: &Type) -> Format

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for DateTime<Local>

§

fn to_sql( &self, type_: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for IpAddr

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for String

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Point<f64>

§

fn to_sql( &self, _: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<'a, T> ToSql for &'a Twhere T: ToSql,

§

fn to_sql( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn encode_format(&self, ty: &Type) -> Format

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for LineString<f64>

§

fn to_sql( &self, _: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<H> ToSql for HashMap<String, Option<String>, H>where H: BuildHasher,

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<'a> ToSql for Cow<'a, [u8]>

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for PrimitiveDateTime

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<'a, T> ToSql for &'a [T]where T: ToSql,

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Box<str, Global>

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Time

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for i64

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for i8

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<'a> ToSql for &'a [u8]

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Date

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for OffsetDateTime

§

fn to_sql( &self, type_: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<const N: usize> ToSql for [u8; N]

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for DateTime<FixedOffset>

§

fn to_sql( &self, type_: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for SmolStr

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Rect<f64>

§

fn to_sql( &self, _: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for MacAddress

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for DateTime<Utc>

§

fn to_sql( &self, type_: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for u32

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<'a> ToSql for Cow<'a, str>

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for SystemTime

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Time

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<T> ToSql for Box<[T], Global>where T: ToSql,

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Uuid

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for f32

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for bool

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for NaiveDate

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Point<f64>

§

fn to_sql( &self, _: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<T, const N: usize> ToSql for [T; N]where T: ToSql,

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<'a> ToSql for &'a str

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for PrimitiveDateTime

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for NaiveDateTime

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for MacAddress

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for NaiveTime

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Rect<f64>

§

fn to_sql( &self, _: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for OffsetDateTime

§

fn to_sql( &self, type_: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for BitVec<u32>

§

fn to_sql( &self, _: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for i32

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for LineString<f64>

§

fn to_sql( &self, _: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Value

§

fn to_sql( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for i16

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Vec<u8, Global>

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for Uuid

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl<T> ToSql for Vec<T, Global>where T: ToSql,

§

fn to_sql( &self, ty: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

impl ToSql for f64

§

fn to_sql( &self, _: &Type, w: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

§

fn accepts(ty: &Type) -> bool

§

fn to_sql_checked( &self, ty: &Type, out: &mut BytesMut ) -> Result<IsNull, Box<dyn Error + Sync + Send, Global>>

Implementors§

§

impl ToSql for PgLsn

§

impl<T> ToSql for postgres::types::Date<T>where T: ToSql,

§

impl<T> ToSql for Timestamp<T>where T: ToSql,

§

impl<T> ToSql for Json<T>where T: Serialize + Debug,