pub trait ColumnValue: Sized + 'static {
const SQL_TYPE: SqlType;
// Required methods
fn to_sqlite_value(&self) -> Value;
fn from_sqlite_value(v: Value) -> Result<Self, DbError>;
}Expand description
A Rust type that knows how to be a column. One impl per type: its canonical form.
Required Associated Constants§
Required Methods§
fn to_sqlite_value(&self) -> Value
fn from_sqlite_value(v: Value) -> Result<Self, DbError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ColumnValue for String
impl ColumnValue for String
Source§impl ColumnValue for Uuid
A Uuid is a 16-byte BLOB: compact, indexable, and readable by any tool that knows the
convention. (day_model::Uuid is uuid::Uuid, so no second dependency edge exists.)
impl ColumnValue for Uuid
A Uuid is a 16-byte BLOB: compact, indexable, and readable by any tool that knows the
convention. (day_model::Uuid is uuid::Uuid, so no second dependency edge exists.)
Source§impl ColumnValue for Vec<u8>
impl ColumnValue for Vec<u8>
Source§impl ColumnValue for bool
impl ColumnValue for bool
Source§impl ColumnValue for f32
impl ColumnValue for f32
Source§impl ColumnValue for f64
impl ColumnValue for f64
Source§impl ColumnValue for i8
impl ColumnValue for i8
Source§impl ColumnValue for i16
impl ColumnValue for i16
Source§impl ColumnValue for i32
impl ColumnValue for i32
Source§impl ColumnValue for i64
impl ColumnValue for i64
Source§impl ColumnValue for isize
impl ColumnValue for isize
Source§impl ColumnValue for u8
impl ColumnValue for u8
Source§impl ColumnValue for u16
impl ColumnValue for u16
Source§impl ColumnValue for u32
impl ColumnValue for u32
Source§impl ColumnValue for u64
impl ColumnValue for u64
Source§impl ColumnValue for usize
impl ColumnValue for usize
Source§impl<T: ColumnValue> ColumnValue for Option<T>
NULL belongs to the framework: Option wraps any column type, encoding is called only on
present values, and a NULL decodes to None, so an impl never sees Null and cannot
disagree about it.
impl<T: ColumnValue> ColumnValue for Option<T>
NULL belongs to the framework: Option wraps any column type, encoding is called only on
present values, and a NULL decodes to None, so an impl never sees Null and cannot
disagree about it.