Struct generational_arena_tree::unified::UnifiedNode
source · pub struct UnifiedNode<Data: Debug> { /* private fields */ }
Available on crate feature
unified
only.Expand description
A node that is not split into separate branch and leaf nodes.
This is the non-deque version, where children are represented as a linked list. In this version, a node’s previous sibling(s) and next sibling(s) are available, but nodes cannot be directly indexed, nor can children be detached, removed, or inserted by index.
[Data
] represents the custom data associated with the the node.
See also
For the deque version, see UnifiedNodeDeque
.
For a node that is split into separate branch and leaf nodes, see
SplitNode
.
Trait Implementations§
source§impl<Data: Debug> BaseNode for UnifiedNode<Data>
impl<Data: Debug> BaseNode for UnifiedNode<Data>
§type Representation = UnifiedNodeRepresentation<Data>
type Representation = UnifiedNodeRepresentation<Data>
§type Branch = UnifiedNode<Data>
type Branch = UnifiedNode<Data>
The type used for branch nodes. Read more
§type Leaf = UnifiedNode<Data>
type Leaf = UnifiedNode<Data>
The type used for leaf nodes. Read more
source§fn into_representation(self, arena: &mut Arena<Self>) -> Self::Representation
fn into_representation(self, arena: &mut Arena<Self>) -> Self::Representation
Converts this node into its representation. Read more
source§impl<Data: Debug> BranchNode for UnifiedNode<Data>
impl<Data: Debug> BranchNode for UnifiedNode<Data>
§type ChildrenIter<'branch> = ChildrenLinked<'branch, UnifiedNode<Data>>
where
Self: 'branch
type ChildrenIter<'branch> = ChildrenLinked<'branch, UnifiedNode<Data>> where Self: 'branch
The iterator returned by
children
.source§fn children<'branch>(
&'branch self,
arena: &'branch Arena<Self>
) -> Self::ChildrenIter<'branch>
fn children<'branch>( &'branch self, arena: &'branch Arena<Self> ) -> Self::ChildrenIter<'branch>
Returns an iterator over the tokens of this branch node’s children.
source§fn pop_front(
token: Self::Token,
arena: &mut Arena<Self>
) -> Option<UnifiedNodeRepresentation<Data>>
fn pop_front( token: Self::Token, arena: &mut Arena<Self> ) -> Option<UnifiedNodeRepresentation<Data>>
Removes this branch node’s first child. Read more
source§fn pop_back(
token: Self::Token,
arena: &mut Arena<Self>
) -> Option<UnifiedNodeRepresentation<Data>>
fn pop_back( token: Self::Token, arena: &mut Arena<Self> ) -> Option<UnifiedNodeRepresentation<Data>>
Removes this branch node’s last child. Read more
source§fn descendants<'branch>(
&'branch self,
arena: &'branch Arena<Self::Base>
) -> Descendants<'branch, Self> ⓘ
fn descendants<'branch>( &'branch self, arena: &'branch Arena<Self::Base> ) -> Descendants<'branch, Self> ⓘ
source§impl<Data: Debug> Hash for UnifiedNode<Data>
impl<Data: Debug> Hash for UnifiedNode<Data>
source§impl<Data: Debug> LinkedNode for UnifiedNode<Data>
impl<Data: Debug> LinkedNode for UnifiedNode<Data>
source§fn preceding_siblings<'node>(
&'node self,
arena: &'node Arena<Self::Base>
) -> PrecedingSiblings<'node, Self> ⓘwhere
Self: Sized,
fn preceding_siblings<'node>(
&'node self,
arena: &'node Arena<Self::Base>
) -> PrecedingSiblings<'node, Self> ⓘwhere
Self: Sized,
source§fn following_siblings<'node>(
&'node self,
arena: &'node Arena<Self::Base>
) -> FollowingSiblings<'node, Self> ⓘwhere
Self: Sized,
fn following_siblings<'node>(
&'node self,
arena: &'node Arena<Self::Base>
) -> FollowingSiblings<'node, Self> ⓘwhere
Self: Sized,
source§impl<Data: Debug> Node for UnifiedNode<Data>
impl<Data: Debug> Node for UnifiedNode<Data>
§type Base = UnifiedNode<Data>
type Base = UnifiedNode<Data>
§type Token = Token<UnifiedNode<Data>>
type Token = Token<UnifiedNode<Data>>
The token associated with this type of node.
§type DataRef<'data> = &'data Data
where
Self: 'data
type DataRef<'data> = &'data Data where Self: 'data
§type DataRefMut<'data> = &'data mut Data
where
Self: 'data
type DataRefMut<'data> = &'data mut Data where Self: 'data
source§fn data_mut(&mut self) -> &mut Self::Data
fn data_mut(&mut self) -> &mut Self::Data
Returns a mutable reference to the data associated with this node.
source§impl<Data: Debug> PartialEq for UnifiedNode<Data>
impl<Data: Debug> PartialEq for UnifiedNode<Data>
impl<Data: Debug> Eq for UnifiedNode<Data>
Auto Trait Implementations§
impl<Data> RefUnwindSafe for UnifiedNode<Data>where
Data: RefUnwindSafe,
impl<Data> Send for UnifiedNode<Data>where
Data: Send,
impl<Data> Sync for UnifiedNode<Data>where
Data: Sync,
impl<Data> Unpin for UnifiedNode<Data>where
Data: Unpin,
impl<Data> UnwindSafe for UnifiedNode<Data>where
Data: 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