#[repr(C)]pub struct KeBoxTree<Weight, Wildness: IWildness = bool, Children: IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>> = DefaultChildrenProvider> { /* private fields */ }
Expand description
A fully owned KeTree.
Note that most of KeBoxTree
’s methods are declared in the IKeyExprTree
and IKeyExprTreeMut
traits.
Implementations§
Source§impl<Weight> KeBoxTree<Weight, bool, DefaultChildrenProvider>where
DefaultChildrenProvider: IChildrenProvider<Box<KeyExprTreeNode<Weight, bool, DefaultChildrenProvider>>>,
impl<Weight> KeBoxTree<Weight, bool, DefaultChildrenProvider>where
DefaultChildrenProvider: IChildrenProvider<Box<KeyExprTreeNode<Weight, bool, DefaultChildrenProvider>>>,
Trait Implementations§
Source§impl<Weight, Children: IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>, Wildness: IWildness> Default for KeBoxTree<Weight, Wildness, Children>
impl<Weight, Children: IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>, Wildness: IWildness> Default for KeBoxTree<Weight, Wildness, Children>
Source§impl<'a, K: AsRef<keyexpr>, Weight, Wildness: IWildness, Children: IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>> FromIterator<(K, Weight)> for KeBoxTree<Weight, Wildness, Children>where
Self: IKeyExprTreeMut<'a, Weight>,
impl<'a, K: AsRef<keyexpr>, Weight, Wildness: IWildness, Children: IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>> FromIterator<(K, Weight)> for KeBoxTree<Weight, Wildness, Children>where
Self: IKeyExprTreeMut<'a, Weight>,
Source§fn from_iter<T: IntoIterator<Item = (K, Weight)>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = (K, Weight)>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, Weight, Children, Wildness: IWildness> IKeyExprTree<'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,
impl<'a, Weight, Children, Wildness: IWildness> IKeyExprTree<'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,
Source§type Node = KeyExprTreeNode<Weight, Wildness, Children>
type Node = KeyExprTreeNode<Weight, Wildness, Children>
The type of a given node in the KeTree. Read more
type TreeIterItem = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::TreeIter as Iterator>::Item
type TreeIter = TreeIter<'a, Children, Box<KeyExprTreeNode<Weight, Wildness, Children>>, Weight>
type IntersectionItem = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Intersection as Iterator>::Item
type Intersection = IterOrOption<Intersection<'a, Children, Box<KeyExprTreeNode<Weight, Wildness, Children>>, Weight>, &'a <KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Node>
type InclusionItem = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Inclusion as Iterator>::Item
type Inclusion = IterOrOption<Inclusion<'a, Children, Box<KeyExprTreeNode<Weight, Wildness, Children>>, Weight>, &'a <KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Node>
type IncluderItem = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Includer as Iterator>::Item
type Includer = IterOrOption<Includer<'a, Children, Box<KeyExprTreeNode<Weight, Wildness, Children>>, Weight>, &'a <KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Node>
Source§fn node(&'a self, at: &keyexpr) -> Option<&'a Self::Node>
fn node(&'a self, at: &keyexpr) -> Option<&'a Self::Node>
Accesses the node at
key
if it exists, treating KEs as if they were completely verbatim keys. Read moreSource§fn tree_iter(&'a self) -> Self::TreeIter
fn tree_iter(&'a self) -> Self::TreeIter
Iterates over the whole tree, including nodes with no weight. Read more
Source§fn intersecting_nodes(&'a self, ke: &'a keyexpr) -> Self::Intersection
fn intersecting_nodes(&'a self, ke: &'a keyexpr) -> Self::Intersection
Iterates over all nodes of the tree whose KE intersects with the given
key
. Read moreSource§fn included_nodes(&'a self, ke: &'a keyexpr) -> Self::Inclusion
fn included_nodes(&'a self, ke: &'a keyexpr) -> Self::Inclusion
Iterates over all nodes of the tree whose KE is included by the given
key
. Read moreSource§fn nodes_including(&'a self, ke: &'a keyexpr) -> Self::Includer
fn nodes_including(&'a self, ke: &'a keyexpr) -> Self::Includer
Iterates over all nodes of the tree whose KE includes the given
key
. Read moreSource§fn weight_at(&'a self, key: &keyexpr) -> Option<&'a Weight>
fn weight_at(&'a self, key: &keyexpr) -> Option<&'a Weight>
Returns a reference to the weight of the node at
key
if it exists.Source§fn key_value_pairs(
&'a self,
) -> FilterMap<Self::TreeIter, fn(Self::TreeIterItem) -> Option<(OwnedKeyExpr, &'a Weight)>> ⓘ
fn key_value_pairs( &'a self, ) -> FilterMap<Self::TreeIter, fn(Self::TreeIterItem) -> Option<(OwnedKeyExpr, &'a Weight)>> ⓘ
Iterates through weighted nodes, yielding their KE and Weight.
Source§fn intersecting_keys(
&'a self,
key: &'a keyexpr,
) -> FilterMap<Self::Intersection, fn(Self::IntersectionItem) -> Option<OwnedKeyExpr>> ⓘ
fn intersecting_keys( &'a self, key: &'a keyexpr, ) -> FilterMap<Self::Intersection, fn(Self::IntersectionItem) -> Option<OwnedKeyExpr>> ⓘ
Returns an iterator over the KEs contained in the tree that intersect with
key
Source§fn included_keys(
&'a self,
key: &'a keyexpr,
) -> FilterMap<Self::Inclusion, fn(Self::InclusionItem) -> Option<OwnedKeyExpr>> ⓘ
fn included_keys( &'a self, key: &'a keyexpr, ) -> FilterMap<Self::Inclusion, fn(Self::InclusionItem) -> Option<OwnedKeyExpr>> ⓘ
Returns an iterator over the KEs contained in the tree that are included by
key
Source§fn keys_including(
&'a self,
key: &'a keyexpr,
) -> FilterMap<Self::Includer, fn(Self::IncluderItem) -> Option<OwnedKeyExpr>> ⓘ
fn keys_including( &'a self, key: &'a keyexpr, ) -> FilterMap<Self::Includer, fn(Self::IncluderItem) -> Option<OwnedKeyExpr>> ⓘ
Returns an iterator over the KEs contained in the tree that include
key
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,
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>
type IncluderItemMut = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTreeMut<'a, Weight>>::IncluderMut as Iterator>::Item
type IncluderMut = IterOrOption<IncluderMut<'a, Children, Box<KeyExprTreeNode<Weight, Wildness, Children>>, Weight>, &'a mut <KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Node>
Source§fn node_mut<'b>(&'b mut self, at: &keyexpr) -> Option<&'b mut Self::Node>
fn node_mut<'b>(&'b mut self, at: &keyexpr) -> Option<&'b mut Self::Node>
Mutably accesses the node at
key
if it exists, treating KEs as if they were completely verbatim keys. Read moreSource§fn remove(&mut self, at: &keyexpr) -> Option<Weight>
fn remove(&mut self, at: &keyexpr) -> Option<Weight>
Clears the weight of the node at
key
, but doesn’t actually destroy the node. Read moreSource§fn node_mut_or_create<'b>(&'b mut self, at: &keyexpr) -> &'b mut Self::Node
fn node_mut_or_create<'b>(&'b mut self, at: &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
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,
ke: &'a keyexpr,
) -> Self::IntersectionMut
fn intersecting_nodes_mut( &'a mut self, ke: &'a keyexpr, ) -> Self::IntersectionMut
Iterates over all nodes of the tree whose KE intersects with the given
key
. Read moreSource§fn included_nodes_mut(&'a mut self, ke: &'a keyexpr) -> Self::InclusionMut
fn included_nodes_mut(&'a mut self, ke: &'a keyexpr) -> Self::InclusionMut
Iterates over all nodes of the tree whose KE is included by the given
key
. Read moreSource§fn nodes_including_mut(&'a mut self, ke: &'a keyexpr) -> Self::IncluderMut
fn nodes_including_mut(&'a mut self, ke: &'a keyexpr) -> Self::IncluderMut
Iterates over all nodes of the tree whose KE includes the given
key
. Read moreSource§fn 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
. Read moreSource§fn weight_at_mut(&'a mut self, key: &keyexpr) -> Option<&'a mut Weight>
fn weight_at_mut(&'a mut self, key: &keyexpr) -> Option<&'a mut Weight>
Returns a mutable reference to the weight of the node at
key
.Auto Trait Implementations§
impl<Weight, Wildness, Children> Freeze for KeBoxTree<Weight, Wildness, Children>where
<Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: Freeze,
Wildness: Freeze,
impl<Weight, Wildness, Children> RefUnwindSafe for KeBoxTree<Weight, Wildness, Children>where
<Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: RefUnwindSafe,
Wildness: RefUnwindSafe,
impl<Weight, Wildness, Children> Send for KeBoxTree<Weight, Wildness, Children>where
<Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: Send,
Wildness: Send,
impl<Weight, Wildness, Children> Sync for KeBoxTree<Weight, Wildness, Children>where
<Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: Sync,
Wildness: Sync,
impl<Weight, Wildness, Children> Unpin for KeBoxTree<Weight, Wildness, Children>where
<Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: Unpin,
Wildness: Unpin,
impl<Weight, Wildness, Children> UnwindSafe for KeBoxTree<Weight, Wildness, Children>where
<Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: UnwindSafe,
Wildness: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more