pub trait ColumnValue {
type Rust;
const TYPE: ColumnType;
// Required method
fn from_value(value: Value) -> Option<Self::Rust>;
}Expand description
The Rust value a column whose SQL type is Self is set to: the SQL type’s
Rust type, or an Option of it for a nullable column.
Required Associated Constants§
Sourceconst TYPE: ColumnType
const TYPE: ColumnType
What the column takes, for the compile-time check that a domain
field’s value fits it: ColumnType::not_null for a NOT NULL SQL
type.
Required Associated Types§
Required Methods§
Sourcefn from_value(value: Value) -> Option<Self::Rust>
fn from_value(value: Value) -> Option<Self::Rust>
The value as that type; None if it does not fit (another type, or a
NULL for a NOT NULL column).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".