mirror of
https://github.com/isar/rusqlite.git
synced 2025-02-17 05:18:13 +08:00
Add FromSql for Box<str>, Rc<str> and Arc<str>
This commit is contained in:
parent
a788d40f10
commit
585797b4d6
@ -166,6 +166,24 @@ impl FromSql for String {
|
||||
}
|
||||
}
|
||||
|
||||
impl FromSql for Box<str> {
|
||||
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
|
||||
value.as_str().map(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromSql for std::rc::Rc<str> {
|
||||
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
|
||||
value.as_str().map(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromSql for std::sync::Arc<str> {
|
||||
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
|
||||
value.as_str().map(Into::into)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromSql for Vec<u8> {
|
||||
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
|
||||
value.as_blob().map(|b| b.to_vec())
|
||||
|
Loading…
x
Reference in New Issue
Block a user