#[non_exhaustive]pub struct Node {
pub id: String,
pub component: String,
pub data_path: String,
pub index: Option<usize>,
pub properties: Map<String, Value>,
pub accessibility: Option<Map<String, Value>>,
pub failures: Vec<Value>,
pub errors: Vec<String>,
pub children: Vec<(String, Vec<Node>)>,
pub placeholder: bool,
}Expand description
One component instance, resolved for drawing.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringThe component’s id.
component: StringThe component type ("" for a placeholder).
data_path: StringThe data context: / at the root, the item’s path inside a template.
index: Option<usize>The item’s index inside the innermost template.
properties: Map<String, Value>The properties with every binding and call resolved. Properties that
only hold child ids and actions are left out: children are in
Node::children, and an action runs through Runtime::dispatch. A
property holding children with other fields (Tabs’ tabs, with each
tab’s title) is kept.
accessibility: Option<Map<String, Value>>@accessibility, resolved.
failures: Vec<Value>The failing check results, in order, each with valid, message,
severity (default error), and any code.
errors: Vec<String>What failed to evaluate on this node (EXPRESSION_ERROR): the property
resolved to null, the node still shows.
children: Vec<(String, Vec<Node>)>The child nodes, by the property that holds them, in catalog order.
placeholder: boolThe component is referenced but not defined yet: draw a placeholder.
Implementations§
Source§impl Node
impl Node
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Whether no check fails with severity error (a button with a failing
check is disabled).
Sourcepub fn validation_errors(&self) -> Vec<String>
pub fn validation_errors(&self) -> Vec<String>
The messages of the failing error checks, in order.
Sourcepub fn validation_result(&self) -> Value
pub fn validation_result(&self) -> Value
The first failing check, or {"valid": true}.