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
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
Implementations on Foreign Types§
source§impl ToSql for DateTime<FixedOffset>
impl ToSql for DateTime<FixedOffset>
Date and time with time zone => RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS[+-]HH:MM”).
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
source§impl ToSql for DateTime<Local>
impl ToSql for DateTime<Local>
Local time => UTC RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS+00:00”).
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
source§impl ToSql for DateTime<Utc>
impl ToSql for DateTime<Utc>
UTC time => UTC RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS+00:00”).
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
source§impl ToSql for NaiveDate
impl ToSql for NaiveDate
ISO 8601 calendar date without timezone => “YYYY-MM-DD”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
source§impl ToSql for NaiveDateTime
impl ToSql for NaiveDateTime
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 NaiveTime
impl ToSql for NaiveTime
ISO 8601 time without timezone => “HH:MM:SS.SSS”