Struct zenoh_keyexpr::keyexpr_tree::arc_tree::KeArcTree
source · 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.
Most of its methods are declared in the ITokenKeyExprTree trait.
Implementations§
source§impl<Weight, Wildness: IWildness, Children: IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, DefaultToken>, DefaultToken>>>> KeArcTree<Weight, DefaultToken, Wildness, Children>
impl<Weight, Wildness: IWildness, Children: IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, DefaultToken>, DefaultToken>>>> KeArcTree<Weight, DefaultToken, Wildness, Children>
sourcepub fn new() -> Result<(Self, DefaultToken), <DefaultToken as TokenTrait>::ConstructionError>
pub fn new() -> Result<(Self, DefaultToken), <DefaultToken as TokenTrait>::ConstructionError>
Constructs the KeArcTree, returning it and its token, unless constructing the Token failed.
§Type inference papercut
Despite some of KeArcTree’s generic parameters having default values, those are only taken into
account by the compiler when a type is named with some parameters omitted, and not when a type is
inferred with the same parameters unconstrained.
The simplest way to resolve this is to eventually assign to tree part of the return value
to a variable or field whose type is named KeArcTree<_> (the Weight parameter can generally be inferred).
source§impl<Weight, Wildness: IWildness, Children: IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>, Token: TokenTrait> KeArcTree<Weight, Token, Wildness, Children>
impl<Weight, Wildness: IWildness, Children: IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>, Token: TokenTrait> KeArcTree<Weight, Token, Wildness, Children>
sourcepub fn with_token(token: &Token) -> Self
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>
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>
source§type Node = (&'a Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, &'a 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>
fn node(&'a self, token: &'a Token, at: &keyexpr) -> Option<Self::Node>
key if it exists, treating KEs as if they were completely verbatim keys. Read moresource§fn node_mut(
&'a self,
token: &'a mut Token,
at: &keyexpr,
) -> Option<Self::NodeMut>
fn node_mut( &'a self, token: &'a mut Token, at: &keyexpr, ) -> Option<Self::NodeMut>
key if it exists, treating KEs as if they were completely verbatim keys. Read moresource§fn node_or_create(&'a self, token: &'a mut Token, at: &keyexpr) -> Self::NodeMut
fn node_or_create(&'a self, token: &'a mut Token, at: &keyexpr) -> Self::NodeMut
key, creating it if necessary.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
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
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
fn intersecting_nodes( &'a self, token: &'a Token, key: &'a keyexpr, ) -> Self::Intersection
key. Read moretype 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
fn intersecting_nodes_mut( &'a self, token: &'a mut Token, key: &'a keyexpr, ) -> Self::IntersectionMut
key. Read moretype 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
fn included_nodes( &'a self, token: &'a Token, key: &'a keyexpr, ) -> Self::Inclusion
key. Read moretype 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
fn included_nodes_mut( &'a self, token: &'a mut Token, key: &'a keyexpr, ) -> Self::InclusionMut
key. Read moretype IncluderItem = <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::Node
type Includer = IterOrOption<TokenPacker<Includer<'a, Children, Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>, Weight>, &'a Token>, <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::IncluderItem>
source§fn nodes_including(
&'a self,
token: &'a Token,
key: &'a keyexpr,
) -> Self::Includer
fn nodes_including( &'a self, token: &'a Token, key: &'a keyexpr, ) -> Self::Includer
key. Read moretype IncluderItemMut = <KeArcTree<Weight, Token, Wildness, Children> as ITokenKeyExprTree<'a, Weight, Token>>::TreeIterItemMut
type IncluderMut = IterOrOption<TokenPacker<Includer<'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>>::IncluderItemMut>
source§fn nodes_including_mut(
&'a self,
token: &'a mut Token,
key: &'a keyexpr,
) -> Self::IncluderMut
fn nodes_including_mut( &'a self, token: &'a mut Token, key: &'a keyexpr, ) -> Self::IncluderMut
key. Read moretype PruneNode = KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>
fn prune_where<F: FnMut(&mut Self::PruneNode) -> bool>( &self, token: &mut Token, predicate: F, )
source§fn insert(
&'a self,
token: &'a mut Token,
at: &keyexpr,
weight: Weight,
) -> Option<Weight>
fn insert( &'a self, token: &'a mut Token, at: &keyexpr, weight: Weight, ) -> Option<Weight>
key, returning the previous weight if it existed.source§fn remove(&'a mut self, token: &'a mut Token, key: &keyexpr) -> Option<Weight>
fn remove(&'a mut self, token: &'a mut Token, key: &keyexpr) -> Option<Weight>
key, but doesn’t actually destroy the node. Read morefn prune(&self, token: &mut Token)
Auto Trait Implementations§
impl<Weight, Token = DefaultToken, Wildness = bool, Children = KeyedSetProvider> !Freeze for KeArcTree<Weight, Token, Wildness, Children>
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
<Token as TokenTrait>::Identifier: Send,
<Children as IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>>::Assoc: Send,
Wildness: 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
<Token as TokenTrait>::Identifier: Unpin,
<Children as IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>>::Assoc: Unpin,
Wildness: Unpin,
impl<Weight, Token, Wildness, Children> UnwindSafe for KeArcTree<Weight, Token, Wildness, Children>where
<Token as TokenTrait>::Identifier: UnwindSafe,
<Children as IChildrenProvider<Arc<TokenCell<KeArcTreeNode<Weight, Weak<()>, Wildness, Children, Token>, Token>>>>::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
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>
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>
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