pub struct ViewDefinition {
pub id: String,
pub api_version: u32,
pub target: GroupVersionKind,
pub columns: Vec<Column>,
pub status: Vec<StatusRule>,
pub conditions: Vec<ConditionRule>,
pub actions: Vec<LensAction>,
}Expand description
The view-definition (lens) document.
Fields§
§id: StringUnique reverse-DNS id, e.g. "com.example.cnpg-lens".
api_version: u32The lens schema version this document was written against. Must equal
LENS_SCHEMA_VERSION (this release refuses anything else).
target: GroupVersionKindThe resource kind this lens describes.
columns: Vec<Column>Columns to render (each is a view-model Column; semantics, not geometry).
status: Vec<StatusRule>Optional status-inference rules, evaluated in order (first match wins).
conditions: Vec<ConditionRule>Optional condition-based status rules (status.conditions[]), evaluated after
status (first match wins within the whole sequence).
actions: Vec<LensAction>Actions this lens makes available, with their RBAC-preflight state.
Implementations§
Source§impl ViewDefinition
impl ViewDefinition
Sourcepub fn actions_as_semantic(&self) -> Vec<Action>
pub fn actions_as_semantic(&self) -> Vec<Action>
Map a lens’s declared actions into the render contract’s semantic::Actions,
resolving each lens-native state (allowed/gated/forbidden) to an
ActionState. This is the “action graph” half of M2.2: the lens declares the
action id and label key; the frontend renders it and the core grey-out/p
reflight logic acts on the ActionState — renderer-agnostic, so the TUI, GUI,
and MCP surface share it.
Trait Implementations§
Source§impl Clone for ViewDefinition
impl Clone for ViewDefinition
Source§fn clone(&self) -> ViewDefinition
fn clone(&self) -> ViewDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more