#[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.

Implementations§

source§

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

source

pub fn new() -> Self

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,

§

type Node = KeyExprTreeNode<Weight, Wildness, Children>

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 litteral keys.
§

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>

source§

fn tree_iter(&'a self) -> Self::TreeIter

Iterates over the whole tree, including nodes with no 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>

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
§

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>

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§

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§

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 litteral keys.
source§

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

Clears the weight of the node at key. 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.
§

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>

source§

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

Iterates over the whole tree, including nodes with no 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>

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
§

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>

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 prune_where<F: FnMut(&mut Self::Node) -> bool>(&mut self, predicate: F)

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

Auto Trait Implementations§

§

impl<Weight, Wildness, Children> RefUnwindSafe for KeBoxTree<Weight, Wildness, Children>
where Wildness: RefUnwindSafe, <Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: RefUnwindSafe,

§

impl<Weight, Wildness, Children> Send for KeBoxTree<Weight, Wildness, Children>
where Wildness: Send, <Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: Send,

§

impl<Weight, Wildness, Children> Sync for KeBoxTree<Weight, Wildness, Children>
where Wildness: Sync, <Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: Sync,

§

impl<Weight, Wildness, Children> Unpin for KeBoxTree<Weight, Wildness, Children>
where Wildness: Unpin, <Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: Unpin,

§

impl<Weight, Wildness, Children> UnwindSafe for KeBoxTree<Weight, Wildness, Children>
where Wildness: UnwindSafe, <Children as IChildrenProvider<Box<KeyExprTreeNode<Weight, Wildness, Children>>>>::Assoc: 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<'a, Weight, T> IKeyExprTreeExt<'a, Weight> for T
where T: IKeyExprTree<'a, Weight>,

source§

fn weight_at(&'a self, key: &keyexpr) -> Option<&'a Weight>

Returns a reference to the weight of the node at key
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 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§

impl<'a, Weight, T> IKeyExprTreeExtMut<'a, Weight> for T
where T: IKeyExprTreeMut<'a, Weight>,

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.
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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.