pub trait ModelColumns:
Model
+ IntoExpr<Self>
+ Sized {
const TENANT_COLUMNS: &'static [&'static str];
// Provided methods
fn table() -> Table<Self> { ... }
fn detail() -> Detail<Self> { ... }
fn version(&self) -> Option<u64> { ... }
}Expand description
The table and detail page a model reads as when its resource declares none: what a
ResourceDef without a table lists and
without a detail shows.
Derive it with ModelColumns, which gives a column to each field
a person reads, whether a form or Toasty writes it. An impl by hand names the model’s tenant
columns; one that keeps the defaults here lists no column and turns the detail page off, for a
resource that declares both.
Required Associated Constants§
Sourceconst TENANT_COLUMNS: &'static [&'static str]
const TENANT_COLUMNS: &'static [&'static str]
Provided Methods§
Sourcefn version(&self) -> Option<u64>
fn version(&self) -> Option<u64>
The record’s #[version] counter, or None for a model without one.
The edit form carries it, so a save refuses a record another save changed since the form
opened. The derive reads the model’s #[version] field; an impl written by hand keeps
this default unless it returns the counter itself.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".