pub trait DbModel {
// Required methods
fn collection_name() -> &'static str;
fn fields() -> Vec<FieldDef>;
fn primary_field() -> &'static str;
// Provided method
fn indexes() -> Vec<IndexDef> { ... }
}Expand description
Marker trait for Rust types that map to ModelVault collection records.
Implement via #[derive(DbModel)] from the optional modelvault-derive crate (re-exported by the
modelvault facade when the derive feature is enabled).
Required Methods§
fn collection_name() -> &'static str
fn fields() -> Vec<FieldDef>
fn primary_field() -> &'static str
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".