Struct generational_arena_tree::unified::UnifiedNodeDeque
source · pub struct UnifiedNodeDeque<Data: Debug> { /* private fields */ }
Available on crate features
unified
and deque
only.Expand description
A node that is not split into separate branch and leaf nodes.
This is the deque version, where children are represented as a VecDeque
. In this
version, a node’s previous sibling(s) and
next sibling(s) are not available, but the node can be
directly indexed, and children can be detached, removed, or inserted by index.
[Data
] represents the custom data associated with the node.
See also
For the non-deque version, see [UnifiedNode
].
For a node that is split into separate branch and leaf nodes, see [SplitNode
] and
[SplitNodeDeque
].
Trait Implementations§
source§impl<Data: Debug> BaseNode for UnifiedNodeDeque<Data>
impl<Data: Debug> BaseNode for UnifiedNodeDeque<Data>
§type Representation = UnifiedNodeRepresentation<Data>
type Representation = UnifiedNodeRepresentation<Data>
§type Branch = UnifiedNodeDeque<Data>
type Branch = UnifiedNodeDeque<Data>
The type used for branch nodes. Read more
§type Leaf = UnifiedNodeDeque<Data>
type Leaf = UnifiedNodeDeque<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 UnifiedNodeDeque<Data>
impl<Data: Debug> BranchNode for UnifiedNodeDeque<Data>
§type ChildrenIter<'branch> = Copied<Iter<'branch, Token<UnifiedNodeDeque<Data>>>>
where
Self: 'branch
type ChildrenIter<'branch> = Copied<Iter<'branch, Token<UnifiedNodeDeque<Data>>>> where Self: 'branch
The iterator returned by
children
.source§fn children<'branch>(
&'branch self,
_arena: &'branch Arena<Self::Base>
) -> Self::ChildrenIter<'branch>
fn children<'branch>( &'branch self, _arena: &'branch Arena<Self::Base> ) -> 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::Base>
) -> Option<UnifiedNodeRepresentation<Data>>
fn pop_front( token: Self::Token, arena: &mut Arena<Self::Base> ) -> Option<UnifiedNodeRepresentation<Data>>
Removes this branch node’s first child. Read more
source§fn pop_back(
token: Self::Token,
arena: &mut Arena<Self::Base>
) -> Option<UnifiedNodeRepresentation<Data>>
fn pop_back( token: Self::Token, arena: &mut Arena<Self::Base> ) -> 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> BranchNodeDeque for UnifiedNodeDeque<Data>
impl<Data: Debug> BranchNodeDeque for UnifiedNodeDeque<Data>
source§fn len(&self) -> usize
fn len(&self) -> usize
Available on crate feature
deque
only.Returns the number of children this branch node has.
source§fn detach(
token: Self::Token,
arena: &mut Arena<Self>,
index: usize
) -> Token<Self>
fn detach( token: Self::Token, arena: &mut Arena<Self>, index: usize ) -> Token<Self>
Available on crate feature
deque
only.source§fn remove(
token: Self::Token,
arena: &mut Arena<Self>,
index: usize
) -> UnifiedNodeRepresentation<Data>
fn remove( token: Self::Token, arena: &mut Arena<Self>, index: usize ) -> UnifiedNodeRepresentation<Data>
Available on crate feature
deque
only.Removes the child at the given
index
. Read moresource§impl<Data: Debug> Hash for UnifiedNodeDeque<Data>
impl<Data: Debug> Hash for UnifiedNodeDeque<Data>
source§impl<Data: Debug> Node for UnifiedNodeDeque<Data>
impl<Data: Debug> Node for UnifiedNodeDeque<Data>
§type Base = UnifiedNodeDeque<Data>
type Base = UnifiedNodeDeque<Data>
§type Token = Token<UnifiedNodeDeque<Data>>
type Token = Token<UnifiedNodeDeque<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 UnifiedNodeDeque<Data>
impl<Data: Debug> PartialEq for UnifiedNodeDeque<Data>
impl<Data: Debug> Eq for UnifiedNodeDeque<Data>
Auto Trait Implementations§
impl<Data> RefUnwindSafe for UnifiedNodeDeque<Data>where
Data: RefUnwindSafe,
impl<Data> Send for UnifiedNodeDeque<Data>where
Data: Send,
impl<Data> Sync for UnifiedNodeDeque<Data>where
Data: Sync,
impl<Data> Unpin for UnifiedNodeDeque<Data>where
Data: Unpin,
impl<Data> UnwindSafe for UnifiedNodeDeque<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