IKeyExprTreeNode

Trait IKeyExprTreeNode 

Source
pub trait IKeyExprTreeNode<Weight>: UIKeyExprTreeNode<Weight> {
    // Provided methods
    fn parent(&self) -> Option<&Self::Parent> { ... }
    fn keyexpr(&self) -> OwnedKeyExpr { ... }
    fn weight(&self) -> Option<&Weight> { ... }
    fn children(&self) -> &Self::Children { ... }
}
Expand description

The non-mutating methods of a KeTree node.

Provided Methods§

Source

fn parent(&self) -> Option<&Self::Parent>

Access the parent node if it exists (the node isn’t the first chunk of a key-expression).

Source

fn keyexpr(&self) -> OwnedKeyExpr

Compute this node’s full key expression.

Note that KeTrees don’t normally store each node’s full key expression. If you need to repeatedly access a node’s full key expression, it is suggested to store that key expression as part of the node’s Weight (it’s optional value).

Source

fn weight(&self) -> Option<&Weight>

Access the node’s weight (or value).

Weights can be assigned to a node through many of IKeyExprTreeNodeMut’s methods, as well as through IKeyExprTreeMut::insert.

Nodes may not have a value in any of the following cases:

  • The node is a parent to other nodes, but was never assigned a weight itself (or that weight has been removed).
  • The node is a leaf of the KeTree whose value was IKeyExprTreeMut::removed, but IKeyExprTreeMut::prune hasn’t been called yet.
Source

fn children(&self) -> &Self::Children

Access a node’s children.

Implementations on Foreign Types§

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight> IKeyExprTreeNode<Weight> for &T

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight> IKeyExprTreeNode<Weight> for &mut T

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight> IKeyExprTreeNode<Weight> for Box<T>

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight, Token: TokenTrait> IKeyExprTreeNode<Weight> for (&Arc<TokenCell<T, Token>>, &Token)

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight, Token: TokenTrait> IKeyExprTreeNode<Weight> for (&Arc<TokenCell<T, Token>>, &mut Token)

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight, Token: TokenTrait> IKeyExprTreeNode<Weight> for (&TokenCell<T, Token>, &Token)

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight, Token: TokenTrait> IKeyExprTreeNode<Weight> for (&TokenCell<T, Token>, &mut Token)

Implementors§

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight, Token: TokenTrait> IKeyExprTreeNode<Weight> for Tokenized<&Arc<TokenCell<T, Token>>, &Token>

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight, Token: TokenTrait> IKeyExprTreeNode<Weight> for Tokenized<&Arc<TokenCell<T, Token>>, &mut Token>

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight, Token: TokenTrait> IKeyExprTreeNode<Weight> for Tokenized<&TokenCell<T, Token>, &Token>

Source§

impl<T: IKeyExprTreeNode<Weight>, Weight, Token: TokenTrait> IKeyExprTreeNode<Weight> for Tokenized<&TokenCell<T, Token>, &mut Token>

Source§

impl<Weight, Parent: IArcProvider, Wildness: IWildness, Children: IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>, Token: TokenTrait> IKeyExprTreeNode<Weight> for KeArcTreeNode<Weight, Parent, Wildness, Children, Token>
where Children::Assoc: IChildren<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>,

Source§

impl<Weight, Wildness: IWildness, Children: IChildrenProvider<Box<Self>>> IKeyExprTreeNode<Weight> for KeyExprTreeNode<Weight, Wildness, Children>
where Children::Assoc: IChildren<Box<Self>>,