pub trait PersistedFields {
const FIELD_NAMES: &'static [&'static str];
const FIELD_TYPES: &'static [ValueType] = _;
}Expand description
A type whose data names domain fields the persistence layer maps onto columns.
They are the fields a generated filter-options model filters on, a query
model filters or sorts by, or a MergePatch model may write.
Implemented by the derives; the persistence layer checks at compile time that each field has a column before writing any SQL for the type’s data.
Required Associated Constants§
Sourceconst FIELD_NAMES: &'static [&'static str]
const FIELD_NAMES: &'static [&'static str]
The domain fields, once each, in declaration order.
Provided Associated Constants§
Sourceconst FIELD_TYPES: &'static [ValueType] = _
const FIELD_TYPES: &'static [ValueType] = _
The value type of each field, in FIELD_NAMES
order (the IntoValue::TYPE of its raw value), for the persistence
layer to check against its column’s type at compile time; empty when
unknown, which checks nothing.
The derives fill it in for a filter-options model and a MergePatch
model, whose data carries values; a query model’s sort keys carry
none.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".