Trait zenoh_keyexpr::keyexpr_tree::traits::IKeyExprTreeMut
source · 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§
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§
sourcefn node_mut<'b>(&'b mut self, key: &keyexpr) -> Option<&'b mut Self::Node>
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.
sourcefn remove(&mut self, key: &keyexpr) -> Option<Weight>
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.
sourcefn node_mut_or_create<'b>(&'b mut self, key: &keyexpr) -> &'b mut Self::Node
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.
sourcefn tree_iter_mut(&'a mut self) -> Self::TreeIterMut
fn tree_iter_mut(&'a mut self) -> Self::TreeIterMut
Iterates over the whole tree, including nodes with no weight.
sourcefn intersecting_nodes_mut(
&'a mut self,
key: &'a keyexpr
) -> Self::IntersectionMut
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.
sourcefn included_nodes_mut(&'a mut self, key: &'a keyexpr) -> Self::InclusionMut
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.
sourcefn prune_where<F: FnMut(&mut Self::Node) -> bool>(&mut self, predicate: F)
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.