Node
struct · ferroui-dynamic-data · v0.5.0
struct Node<T, K>
A node of a tree (Node<TObject, TKey>): an item, its key, its parent and its children, as
TransformToTree builds them. Nodes are held in Rc.
Deviation (DEVIATIONS.md, DynamicData): a node holds its parent weakly, so that a parent and its children (which it holds) do not keep each other alive; the parent of a node is the node of the tree that is its parent, which the tree keeps.
Members
new
fn new(item: T, key: K) -> Rc<Self>
A node without a parent (Node(TObject, TKey)).
with_parent
fn with_parent(item: T, key: K, parent: Option<&Rc<Node<T, K>>>) -> Rc<Self>
A node of parent (Node(TObject, TKey, in Optional<Node<TObject, TKey>>)).
children
fn children(self: &Self) -> &ObservableCache<Rc<Node<T, K>>, K>
The child nodes (Children).
depth
fn depth(self: &Self) -> usize
The number of ancestors of the node (Depth).
is_root
fn is_root(self: &Self) -> bool
Whether the node has no parent (IsRoot).
item
fn item(self: &Self) -> &T
The item (Item).
key
fn key(self: &Self) -> &K
The key of the item (Key).
parent
fn parent(self: &Self) -> Option<Rc<Node<T, K>>>
The parent node (Parent).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyToStringEquivalent<K>IDisposablePartialEqEqHashDisplayDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.