pub struct FlatNode {
pub children: IndexMap<String, Option<String>>,
pub inherits: IndexMap<String, String>,
pub attributes: IndexMap<String, Arc<Value>>,
}Expand description
All opinions about one path, merged in layer order.
Upstream calls this a pre-composition node. References are still paths; composition resolves them.
Fields§
§children: IndexMap<String, Option<String>>Child name to referenced path. A None value survives flattening so
that composition can delete a child inherited from elsewhere.
inherits: IndexMap<String, String>Inherit name to referenced path. null entries are already applied
and removed.
attributes: IndexMap<String, Arc<Value>>Attribute values. A JSON null is kept as a value, as upstream does;
it does not delete the attribute.
Implementations§
Source§impl FlatNode
impl FlatNode
Sourcepub fn merge(&mut self, node: &IfcxNode)
pub fn merge(&mut self, node: &IfcxNode)
Merges one later opinion into this node.
For each map, entries of node are applied in their order and replace
an existing entry of the same name in place:
children: the value is stored as written,Noneincluded;inherits:Noneremoves the entry, a path sets it;attributes: the value is stored as written,nullincluded.
The node’s path and unknown fields are not looked at.
Sourcepub fn merge_owned(&mut self, node: IfcxNode)
pub fn merge_owned(&mut self, node: IfcxNode)
Merges one later opinion into this node, moving its maps and attribute
values instead of copying them. Same rules as merge.