rustio_admin/view_layer/mod.rs
1//! Adaptive View Layer.
2//!
3//! The database schema knows field names and types but not visual importance.
4//! This module lets rustio-admin record that importance once, as a stable
5//! [`ViewSpec`], and render generated tables/lists/cards deterministically.
6//!
7//! Runtime contract: rendering reads a saved `ViewSpec` and nothing else. No
8//! AI, no dynamic guessing, no non-determinism. Inference ([`infer`]) and the
9//! future view designer only ever *produce* a `ViewSpec`; the saved spec is
10//! always the source of truth.
11//!
12//! The layer is purely additive and presentation-only. It owns no search,
13//! filtering, sorting, pagination, actions, or permissions — when a model has
14//! no saved spec, callers fall back to the existing table path unchanged.
15
16// public:
17pub mod compose;
18// public:
19pub mod infer;
20// public:
21pub mod modes;
22// public:
23pub mod render;
24// public:
25pub mod roles;
26// public:
27pub mod spec;
28
29#[cfg(test)]
30mod safety_tests;
31
32// public:
33pub use compose::{CellComposition, ComposeStyle};
34// public:
35pub use infer::{infer_view_spec, infer_view_spec_from_fields, FieldKind, FieldMeta};
36// public:
37pub use modes::ViewMode;
38// public:
39pub use render::{
40 render_row, render_view, render_view_with_ids, CellPart, RenderedCell, RenderedRow,
41 RenderedView, RowData,
42};
43// public:
44pub use roles::{FieldRole, SemanticClass};
45// public:
46pub use spec::{FieldViewSpec, ViewSpec, VIEW_SPEC_VERSION};