pub trait DbType:
Sized
+ Send
+ Sync
+ 'static {
const SQL_TYPE: SqlType;
const NULLABLE: bool = false;
// Required methods
fn to_value(&self) -> Value;
fn from_value(value: Value) -> Result<Self, String>;
}Expand description
A Rust type that can be stored in a model column.
Required Associated Constants§
Provided Associated Constants§
Required Methods§
Sourcefn from_value(value: Value) -> Result<Self, String>
fn from_value(value: Value) -> Result<Self, String>
Decode from a value read from any backend.
§Errors
A human-readable reason when value has the wrong shape; callers wrap
it into QueryError::Decode with the column name.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".