KeBoxTree

Struct KeBoxTree 

Source
#[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§

Trait Implementations§

Source§

impl<Weight, Children: IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>, Wildness: IWildness> Default for KeBoxTree<Weight, Wildness, Children>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
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>,

Source§

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,

Source§

type Node = KeyExprTreeNode<Weight, Wildness, Children>

The type of a given node in the KeTree. Read more
Source§

type TreeIterItem = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::TreeIter as Iterator>::Item

Source§

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

Source§

type IntersectionItem = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Intersection as Iterator>::Item

Source§

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

Source§

type InclusionItem = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Inclusion as Iterator>::Item

Source§

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

Source§

type IncluderItem = <<KeBoxTree<Weight, Wildness, Children> as IKeyExprTree<'a, Weight>>::Includer as Iterator>::Item

Source§

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>

Accesses the node at key if it exists, treating KEs as if they were completely verbatim keys. Read more
Source§

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

Iterates over all nodes of the tree whose KE intersects with the given key. Read more
Source§

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 more
Source§

fn nodes_including(&'a self, ke: &'a keyexpr) -> Self::Includer

Iterates over all nodes of the tree whose KE includes the given key. Read more
Source§

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)>>
where Self::TreeIterItem: AsNode<Box<Self::Node>>,

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>>
where Self::IntersectionItem: AsNode<Self::Node>, Self::Node: IKeyExprTreeNode<Weight>,

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>>
where Self::InclusionItem: AsNode<Self::Node>, Self::Node: IKeyExprTreeNode<Weight>,

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>>
where Self::IncluderItem: AsNode<Self::Node>, Self::Node: IKeyExprTreeNode<Weight>,

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,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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>

Mutably accesses the node at key if it exists, treating KEs as if they were completely verbatim keys. Read more
Source§

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

Clears the weight of the node at key, but doesn’t actually destroy the node. Read more
Source§

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

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

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 more
Source§

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 more
Source§

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 more
Source§

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

Prunes node from the tree where the predicate returns true. Read more
Source§

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.
Source§

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

Inserts a weight at key, returning the previous weight if it existed.
Source§

fn prune(&mut self)

Prunes empty nodes from the tree, unless they have at least one non-empty descendent.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsNode<T> for T

Source§

fn as_node(&self) -> &T

Source§

impl<T> AsNodeMut<T> for T

Source§

fn as_node_mut(&mut self) -> &mut T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.