Trait diesel::types::ToSql
[−]
[src]
pub trait ToSql<A, DB: Backend + HasSqlType<A>>: Debug { fn to_sql<W: Write>(
&self,
out: &mut ToSqlOutput<W, DB>
) -> Result<IsNull, Box<Error + Send + Sync>>; }
Serializes a single value to be sent to the database. The output will be included as a bind parameter, and is expected to be the binary format, not text.
Required Methods
fn to_sql<W: Write>(
&self,
out: &mut ToSqlOutput<W, DB>
) -> Result<IsNull, Box<Error + Send + Sync>>
&self,
out: &mut ToSqlOutput<W, DB>
) -> Result<IsNull, Box<Error + Send + Sync>>
Implementors
impl<DB: Backend> ToSql<Float, DB> for f32
impl<DB: Backend> ToSql<Double, DB> for f64
impl<DB: Backend> ToSql<SmallInt, DB> for i16
impl<DB: Backend> ToSql<Integer, DB> for i32
impl<DB: Backend> ToSql<BigInt, DB> for i64
impl<T, ST, DB> ToSql<Nullable<ST>, DB> for Option<T> where
T: ToSql<ST, DB>,
DB: Backend + HasSqlType<ST>,
ST: NotNull,impl<'a, DB> ToSql<Nullable<Bool>, DB> for bool where
DB: Backend + HasSqlType<Bool>,
bool: ToSql<Bool, DB>,impl<'a, DB> ToSql<Nullable<SmallInt>, DB> for i16 where
DB: Backend + HasSqlType<SmallInt>,
i16: ToSql<SmallInt, DB>,impl<'a, DB> ToSql<Nullable<Integer>, DB> for i32 where
DB: Backend + HasSqlType<Integer>,
i32: ToSql<Integer, DB>,impl<'a, DB> ToSql<Nullable<BigInt>, DB> for i64 where
DB: Backend + HasSqlType<BigInt>,
i64: ToSql<BigInt, DB>,impl<'a, DB> ToSql<Nullable<Float>, DB> for f32 where
DB: Backend + HasSqlType<Float>,
f32: ToSql<Float, DB>,impl<'a, DB> ToSql<Nullable<Double>, DB> for f64 where
DB: Backend + HasSqlType<Double>,
f64: ToSql<Double, DB>,impl<'a, DB> ToSql<Nullable<Text>, DB> for String where
DB: Backend + HasSqlType<Text>,
String: ToSql<Text, DB>,impl<'a, DB> ToSql<Nullable<Binary>, DB> for Vec<u8> where
DB: Backend + HasSqlType<Binary>,
Vec<u8>: ToSql<Binary, DB>,impl<'a, DB> ToSql<Nullable<Text>, DB> for &'a str where
DB: Backend + HasSqlType<Text>,
&'a str: ToSql<Text, DB>,impl<'a, DB> ToSql<Nullable<Binary>, DB> for &'a [u8] where
DB: Backend + HasSqlType<Binary>,
&'a [u8]: ToSql<Binary, DB>,impl<'a, DB: Backend> ToSql<Text, DB> for &'a str
impl<DB> ToSql<Text, DB> for String where
DB: Backend,
&'a str: ToSql<Text, DB>,impl<DB> ToSql<Binary, DB> for Vec<u8> where
DB: Backend,
&'a [u8]: ToSql<Binary, DB>,impl<'a, DB: Backend> ToSql<Binary, DB> for &'a [u8]
impl<'a, T: ?Sized, ST, DB> ToSql<ST, DB> for Cow<'a, T> where
T: 'a + ToOwned + ToSql<ST, DB>,
DB: Backend + HasSqlType<ST>,
T::Owned: ToSql<ST, DB>,impl<'a, A, T, DB> ToSql<A, DB> for &'a T where
DB: Backend + HasSqlType<A>,
T: ToSql<A, DB>,impl<'a, ST, T> ToSql<Array<ST>, Pg> for &'a [T] where
Pg: HasSqlType<ST>,
T: ToSql<ST, Pg>,impl<'a, ST, T> ToSql<Nullable<Array<ST>>, Pg> for &'a [T] where
Pg: HasSqlType<ST>,
&'a [T]: ToSql<Array<ST>, Pg>,impl<ST, T> ToSql<Array<ST>, Pg> for Vec<T> where
Pg: HasSqlType<ST>,
&'a [T]: ToSql<Array<ST>, Pg>,
T: Debug,impl<ST, T> ToSql<Nullable<Array<ST>>, Pg> for Vec<T> where
Pg: HasSqlType<ST>,
Vec<T>: ToSql<Array<ST>, Pg>,impl<ST, T> ToSql<Range<ST>, Pg> for (Bound<T>, Bound<T>) where
Pg: HasSqlType<ST> + HasSqlType<Range<ST>>,
T: ToSql<ST, Pg>,impl<'a, DB> ToSql<Nullable<Timestamp>, DB> for SystemTime where
DB: Backend + HasSqlType<Timestamp>,
SystemTime: ToSql<Timestamp, DB>,impl ToSql<Timestamp, Pg> for SystemTime
impl<'a, DB> ToSql<Nullable<Date>, DB> for PgDate where
DB: Backend + HasSqlType<Date>,
PgDate: ToSql<Date, DB>,impl<'a, DB> ToSql<Nullable<Time>, DB> for PgTime where
DB: Backend + HasSqlType<Time>,
PgTime: ToSql<Time, DB>,impl<'a, DB> ToSql<Nullable<Timestamp>, DB> for PgTimestamp where
DB: Backend + HasSqlType<Timestamp>,
PgTimestamp: ToSql<Timestamp, DB>,impl<'a, DB> ToSql<Nullable<Timestamptz>, DB> for PgTimestamp where
DB: Backend + HasSqlType<Timestamptz>,
PgTimestamp: ToSql<Timestamptz, DB>,impl<'a, DB> ToSql<Nullable<Interval>, DB> for PgInterval where
DB: Backend + HasSqlType<Interval>,
PgInterval: ToSql<Interval, DB>,impl ToSql<Timestamp, Pg> for PgTimestamp
impl ToSql<Timestamptz, Pg> for PgTimestamp
impl ToSql<Date, Pg> for PgDate
impl ToSql<Time, Pg> for PgTime
impl ToSql<Interval, Pg> for PgInterval
impl ToSql<Numeric, Pg> for PgNumeric
impl<'a, DB> ToSql<Nullable<Oid>, DB> for u32 where
DB: Backend + HasSqlType<Oid>,
u32: ToSql<Oid, DB>,impl ToSql<Oid, Pg> for u32
impl<'a, DB> ToSql<Nullable<Numeric>, DB> for PgNumeric where
DB: Backend + HasSqlType<Numeric>,
PgNumeric: ToSql<Numeric, DB>,impl ToSql<Bool, Pg> for bool
impl<'a, DB> ToSql<Nullable<Money>, DB> for PgMoney where
DB: Backend + HasSqlType<Money>,
PgMoney: ToSql<Money, DB>,impl ToSql<Money, Pg> for PgMoney