Trait SQLiteFromSQL

Source
pub trait SQLiteFromSQL: Sized {
    // Required method
    fn column_result(value: ValueRef<'_>) -> Result<Self, FromSqlError>;
}
Expand description

A trait for types that can be created from a SQLite value.

Note that FromSql and ToSql are defined for most integral types, but not u64 or usize. This is intentional; SQLite returns integers as signed 64-bit values, which cannot fully represent the range of these types. Rusqlite would have to decide how to handle negative values: return an error or reinterpret as a very large postive numbers, neither of which is guaranteed to be correct for everyone. Callers can work around this by fetching values as i64 and then doing the interpretation themselves or by defining a newtype and implementing FromSql/ToSql for it.

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromSql for bool

Source§

impl FromSql for f64

Source§

impl FromSql for i8

Source§

impl FromSql for i16

Source§

impl FromSql for i32

Source§

impl FromSql for i64

Source§

impl FromSql for isize

Source§

impl FromSql for u8

Source§

impl FromSql for u16

Source§

impl FromSql for u32

Source§

impl FromSql for String

Source§

impl FromSql for Vec<u8>

Source§

impl FromSql for Timespec

Source§

impl<T> FromSql for Option<T>
where T: FromSql,

Implementors§