pub trait ToSql {
// Required method
fn to_sql(&self) -> Result<ToSqlOutput<'_>>;
}Expand description
A trait for types that can be converted into SQLite values. Returns
crate::Error::ToSqlConversionFailure if the conversion fails.
Required Methods§
Sourcefn to_sql(&self) -> Result<ToSqlOutput<'_>>
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Converts Rust value to SQLite value
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ToSql for Date
ISO 8601 calendar date without timezone => “YYYY-MM-DD”
impl ToSql for Date
ISO 8601 calendar date without timezone => “YYYY-MM-DD”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for NonZeroI16
impl ToSql for NonZeroI16
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for NonZeroI32
impl ToSql for NonZeroI32
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for NonZeroI64
impl ToSql for NonZeroI64
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for NonZeroIsize
impl ToSql for NonZeroIsize
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for NonZeroU16
impl ToSql for NonZeroU16
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for NonZeroU32
impl ToSql for NonZeroU32
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for OffsetDateTime
OffsetDatetime => RFC3339 format (“YYYY-MM-DD HH:MM:SS.SSS[+-]HH:MM”)
impl ToSql for OffsetDateTime
OffsetDatetime => RFC3339 format (“YYYY-MM-DD HH:MM:SS.SSS[+-]HH:MM”)
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for PrimitiveDateTime
ISO 8601 combined date and time without timezone => “YYYY-MM-DD HH:MM:SS.SSS”
impl ToSql for PrimitiveDateTime
ISO 8601 combined date and time without timezone => “YYYY-MM-DD HH:MM:SS.SSS”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for Time
ISO 8601 time without timezone => “HH:MM:SS.SSS”
impl ToSql for Time
ISO 8601 time without timezone => “HH:MM:SS.SSS”