FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    new

    fn new(item: T, key: K) -> Rc<Self>
    

    A node without a parent (Node(TObject, TKey)).

    Source

    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>>)).

    Source

    children

    fn children(self: &Self) -> &ObservableCache<Rc<Node<T, K>>, K>
    

    The child nodes (Children).

    Source

    depth

    fn depth(self: &Self) -> usize
    

    The number of ancestors of the node (Depth).

    Source

    is_root

    fn is_root(self: &Self) -> bool
    

    Whether the node has no parent (IsRoot).

    Source

    item

    fn item(self: &Self) -> &T
    

    The item (Item).

    Source

    key

    fn key(self: &Self) -> &K
    

    The key of the item (Key).

    Source

    parent

    fn parent(self: &Self) -> Option<Rc<Node<T, K>>>
    

    The parent node (Parent).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToString
    • Equivalent<K>
    • IDisposable
    • PartialEq
    • Eq
    • Hash
    • Display
    • Debug

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.