pub trait IKeyExprTreeMut<'a, Weight>: IKeyExprTree<'a, Weight> {
    type TreeIterItemMut;
    type TreeIterMut: Iterator<Item = Self::TreeIterItemMut>;
    type IntersectionItemMut;
    type IntersectionMut: Iterator<Item = Self::IntersectionItemMut>;
    type InclusionItemMut;
    type InclusionMut: Iterator<Item = Self::InclusionItemMut>;

    // Required methods
    fn node_mut<'b>(&'b mut self, key: &keyexpr) -> Option<&'b mut Self::Node>;
    fn remove(&mut self, key: &keyexpr) -> Option<Weight>;
    fn node_mut_or_create<'b>(&'b mut self, key: &keyexpr) -> &'b mut Self::Node;
    fn tree_iter_mut(&'a mut self) -> Self::TreeIterMut;
    fn intersecting_nodes_mut(
        &'a mut self,
        key: &'a keyexpr
    ) -> Self::IntersectionMut;
    fn included_nodes_mut(&'a mut self, key: &'a keyexpr) -> Self::InclusionMut;
    fn prune_where<F: FnMut(&mut Self::Node) -> bool>(&mut self, predicate: F);
}
Expand description

The basic mutable methods of all all KeTrees

Required Associated Types§

Required Methods§

source

fn node_mut<'b>(&'b mut self, key: &keyexpr) -> Option<&'b mut Self::Node>

Mutably accesses the node at key if it exists, treating KEs as if they were litteral keys.

source

fn remove(&mut self, key: &keyexpr) -> Option<Weight>

Clears the weight of the node at key.

To actually destroy nodes, IKeyExprTreeMut::prune_where or IKeyExprTreeExtMut::prune must be called.

source

fn node_mut_or_create<'b>(&'b mut self, key: &keyexpr) -> &'b mut Self::Node

Mutably accesses the node at key, creating it if necessary.

source

fn tree_iter_mut(&'a mut self) -> Self::TreeIterMut

Iterates over the whole tree, including nodes with no weight.

source

fn intersecting_nodes_mut( &'a mut self, key: &'a keyexpr ) -> Self::IntersectionMut

Iterates over all nodes of the tree whose KE intersects with the given key.

Note that nodes without a Weight will also be yielded by the iterator.

source

fn included_nodes_mut(&'a mut self, key: &'a keyexpr) -> Self::InclusionMut

Iterates over all nodes of the tree whose KE is included by the given key.

Note that nodes without a Weight will also be yielded by the iterator.

source

fn prune_where<F: FnMut(&mut Self::Node) -> bool>(&mut self, predicate: F)

Prunes node from the tree where the predicate returns true.

Note that nodes that still have children will not be pruned.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, Weight, Children, Wildness: IWildness> IKeyExprTreeMut<'a, Weight> for KeBoxTree<Weight, Wildness, Children>
where Weight: 'a, Children: 'a + IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>, Children::Assoc: IChildren<Box<KeyExprTreeNode<Weight, Wildness, Children>>, Node = Box<KeyExprTreeNode<Weight, Wildness, Children>>> + 'a,

§

type TreeIterItemMut = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTreeMut<'a, Weight>>::TreeIterMut as Iterator>::Item

§

type TreeIterMut = TreeIterMut<'a, Children, Box<KeyExprTreeNode<Weight, Wildness, Children>>, Weight>

§

type IntersectionItemMut = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTreeMut<'a, Weight>>::IntersectionMut as Iterator>::Item

§

type IntersectionMut = IterOrOption<IntersectionMut<'a, Children, Box<KeyExprTreeNode<Weight, Wildness, Children>>, Weight>, &'a mut <KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Node>

§

type InclusionItemMut = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTreeMut<'a, Weight>>::InclusionMut as Iterator>::Item

§

type InclusionMut = IterOrOption<InclusionMut<'a, Children, Box<KeyExprTreeNode<Weight, Wildness, Children>>, Weight>, &'a mut <KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Node>