mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
Add impl ToSql for ToSqlOutput.
This commit is contained in:
parent
354f45cbe2
commit
aa6c542202
@ -28,6 +28,18 @@ impl<'a, T: Into<Value>> From<T> for ToSqlOutput<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> ToSql for ToSqlOutput<'a> {
|
||||
fn to_sql(&self) -> Result<ToSqlOutput> {
|
||||
Ok(match *self {
|
||||
ToSqlOutput::Borrowed(v) => ToSqlOutput::Borrowed(v),
|
||||
ToSqlOutput::Owned(ref v) => ToSqlOutput::Borrowed(ValueRef::from(v)),
|
||||
|
||||
#[cfg(feature = "blob")]
|
||||
ToSqlOutput::ZeroBlob(i) => ToSqlOutput::ZeroBlob(i),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait for types that can be converted into SQLite values.
|
||||
pub trait ToSql {
|
||||
fn to_sql(&self) -> Result<ToSqlOutput>;
|
||||
|
Loading…
Reference in New Issue
Block a user