pub struct ComposedNode {
pub path: String,
pub attributes: IndexMap<String, Arc<Value>>,
pub children: IndexMap<String, Arc<ComposedNode>>,
}Expand description
One node of the composed tree. Upstream calls this a post-composition node.
Children are shared through Arc: every instance that inherits a type
points at the same composed sub-tree instead of a copy. A sub-tree is
copied, one node at a time along the edited path, only where a path such
as instance/Body edits it.
Fields§
§path: StringThe path whose opinions started this node, upstream’s node field.
A child reached through children: {"Body": "b1"} has path b1; a
child copied from an inherited node keeps that node’s path. Empty for
the artificial root.
attributes: IndexMap<String, Arc<Value>>Inherited attributes first, then local ones, which win.
children: IndexMap<String, Arc<ComposedNode>>Implementations§
Source§impl ComposedNode
impl ComposedNode
Sourcepub fn descendant(self: &Arc<Self>, path: &str) -> Option<&Arc<ComposedNode>>
pub fn descendant(self: &Arc<Self>, path: &str) -> Option<&Arc<ComposedNode>>
Follows child names separated by /, as upstream’s
GetChildNodeWithPath. An empty path returns this node.
Trait Implementations§
Source§impl Clone for ComposedNode
impl Clone for ComposedNode
Source§fn clone(&self) -> ComposedNode
fn clone(&self) -> ComposedNode
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComposedNode
impl Debug for ComposedNode
Source§impl Default for ComposedNode
impl Default for ComposedNode
Source§fn default() -> ComposedNode
fn default() -> ComposedNode
Returns the “default value” for a type. Read more
Source§impl Drop for ComposedNode
impl Drop for ComposedNode
Source§impl PartialEq for ComposedNode
impl PartialEq for ComposedNode
impl StructuralPartialEq for ComposedNode
Auto Trait Implementations§
impl Freeze for ComposedNode
impl RefUnwindSafe for ComposedNode
impl Send for ComposedNode
impl Sync for ComposedNode
impl Unpin for ComposedNode
impl UnwindSafe for ComposedNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more