Expand description
AdminUiModel → Form bridge + model registry.
Lifts an admin-level metadata description (column data types,
relations, options) into a FormConfig the existing form engine
already knows how to render. The mapping is purely declarative and
deterministic: same input → same output, every time.
The trait + struct here are deliberately named AdminUiModel /
AdminUiField (not AdminModel / AdminField). The framework’s
existing admin layer in crate::admin already owns the unsuffixed
names with a different shape; the Ui suffix keeps the two
vocabularies unambiguous in any glob import.
As of this step the trait uses &self methods (object-safe)
so an AdminRegistry can store Box<dyn AdminUiModel> and the
/admin-new/<slug> route can pick a model by URL slug.
Structs§
- Admin
Registry - Slug → factory mapping for the
/admin-new/<slug>dispatcher. - Admin
UiField
Enums§
- Admin
Data Type - Storage / semantic data type for a column. Translated into a form
FieldTypebyform_from_admin_ui_model. - Filter
Type - How a filter input should render and how SQL should query it.
Resolved from
AdminUiFieldviaresolve_filter_type.
Traits§
- Admin
UiModel - A model that can describe its admin-UI shape (display name + table mapping + column list + searchable / sortable / filterable / status semantics).
Functions§
- form_
from_ admin_ ui_ model - Build a
FormConfigfrom anAdminUiModelimpl. The drawer title becomes"Edit <model_name>"; subtitle is empty (theAdminUiModelcontract has no subtitle slot today). - resolve_
filter_ type - Decide which control + SQL operator a filter on
fieldshould use. Pure function — does not look at any data, only metadata.
Type Aliases§
- Model
Factory - Boxed factory: any
Fn(closure orfnpointer) that yields a freshBox<dyn AdminUiModel>and is safe to share across the async runtime.