pub struct KeArcTree<Weight, Token: TokenTrait = DefaultToken, Wildness: IWildness = bool, Children: IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>> = DefaultChildrenProvider> { /* private fields */ }
Expand description

A shared KeTree.

The tree and its nodes have shared ownership, while their mutability is managed through the Token. The (node, &token) tuple implements core::ops::Deref, while (node, &mut token) implements core::ops::DerefMut.

Implementations§

source§

impl<Weight, Wildness: IWildness, Children: IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, DefaultToken>, DefaultToken>>>> KeArcTree<Weight, DefaultToken, Wildness, Children>

source

pub fn new( ) -> Result<(Self, DefaultToken), <DefaultToken as TokenTrait>::ConstructionError>

Constructs the KeArcTree, returning it and its token, unless constructing the Token failed.

source§

impl<Weight, Wildness: IWildness, Children: IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>, Token: TokenTrait> KeArcTree<Weight, Token, Wildness, Children>

source

pub fn with_token(token: &Token) -> Self

Constructs the KeArcTree with a specific token.

Trait Implementations§

source§

impl<'a, Weight: 'a, Wildness: IWildness + 'a, Children: IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>> + 'a, Token: TokenTrait + 'a> ITokenKeyExprTree<'a, Weight, Token> for KeArcTree<Weight, Token, Wildness, Children>where Children::Assoc: IChildren<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>,

§

type Node = (&'a Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, &'a Token)

§

type NodeMut = (&'a Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, &'a mut Token)

source§

fn node(&'a self, token: &'a Token, at: &keyexpr) -> Option<Self::Node>

source§

fn node_mut( &'a self, token: &'a mut Token, at: &keyexpr ) -> Option<Self::NodeMut>

source§

fn node_or_create(&'a self, token: &'a mut Token, at: &keyexpr) -> Self::NodeMut

§

type TreeIterItem = <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::Node

§

type TreeIter = TokenPacker<TreeIter<'a, Children, Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, Weight>, &'a Token>

source§

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

§

type TreeIterItemMut = Tokenized<&'a Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, &'a mut Token>

§

type TreeIterMut = TokenPacker<TreeIter<'a, Children, Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, Weight>, &'a mut Token>

source§

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

§

type IntersectionItem = <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::Node

§

type Intersection = IterOrOption<TokenPacker<Intersection<'a, Children, Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, Weight>, &'a Token>, <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::IntersectionItem>

source§

fn intersecting_nodes( &'a self, token: &'a Token, key: &'a keyexpr ) -> Self::Intersection

§

type IntersectionItemMut = <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::TreeIterItemMut

§

type IntersectionMut = IterOrOption<TokenPacker<Intersection<'a, Children, Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, Weight>, &'a mut Token>, <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::IntersectionItemMut>

source§

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

§

type InclusionItem = <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::Node

§

type Inclusion = IterOrOption<TokenPacker<Inclusion<'a, Children, Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, Weight>, &'a Token>, <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::InclusionItem>

source§

fn included_nodes( &'a self, token: &'a Token, key: &'a keyexpr ) -> Self::Inclusion

§

type InclusionItemMut = <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::TreeIterItemMut

§

type InclusionMut = IterOrOption<TokenPacker<Inclusion<'a, Children, Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, Weight>, &'a mut Token>, <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::InclusionItemMut>

source§

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

§

type PruneNode = KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>

source§

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

Auto Trait Implementations§

§

impl<Weight, Token = DefaultToken, Wildness = bool, Children = KeyedSetProvider> !RefUnwindSafe for KeArcTree<Weight, Token, Wildness, Children>

§

impl<Weight, Token, Wildness, Children> Send for KeArcTree<Weight, Token, Wildness, Children>where Wildness: Send, <Children as IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>>::Assoc: Send, <Token as TokenTrait>::Identifier: Send,

§

impl<Weight, Token, Wildness, Children> Sync for KeArcTree<Weight, Token, Wildness, Children>

§

impl<Weight, Token, Wildness, Children> Unpin for KeArcTree<Weight, Token, Wildness, Children>where Wildness: Unpin, <Children as IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>>::Assoc: Unpin, <Token as TokenTrait>::Identifier: Unpin,

§

impl<Weight, Token, Wildness, Children> UnwindSafe for KeArcTree<Weight, Token, Wildness, Children>where Wildness: UnwindSafe, <Children as IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>>::Assoc: UnwindSafe, <Token as TokenTrait>::Identifier: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere 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 Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, Token, T> ITokenKeyExprTreeExt<'a, Weight, Token> for Twhere T: ITokenKeyExprTree<'a, Weight, Token>,

source§

fn insert( &'a self, token: &'a mut Token, at: &keyexpr, weight: Weight ) -> Option<Weight>

source§

fn prune(&self, token: &mut Token)

source§

impl<T, U> Into<U> for Twhere 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 Twhere 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 Twhere 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.