pub trait ValueCodec<T>: 'static {
const SQL_TYPE: SqlType;
// Required methods
fn to_sqlite_value(v: &T) -> Value;
fn from_sqlite_value(v: Value) -> Result<T, DbError>;
}Expand description
A named alternative representation for T, serde’s #[serde(with = …)] idiom.
Implement on a unit struct; select it per field with #[model(with = …)].
Required Associated Constants§
Required Methods§
fn to_sqlite_value(v: &T) -> Value
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".