pub enum SplitNodeDeque<BranchData: Debug, LeafData: Debug> {
Branch(BranchDeque<BranchData, LeafData>),
Leaf(LeafDeque<BranchData, LeafData>),
}
Available on crate features
deque
and split
only.Expand description
A node that is 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 branches can be
directly indexed, and children can be detached, removed, or inserted by index.
BranchData
represents the custom data associated with branches, while
LeafData
represents the custom data associated with leaves.
§See also
For the non-deque version, see SplitNode
.
For a node that isn’t split into separate branch and leaf nodes, see
UnifiedNode
and UnifiedNodeDeque
.
Variants§
Branch(BranchDeque<BranchData, LeafData>)
Leaf(LeafDeque<BranchData, LeafData>)
Trait Implementations§
Source§impl<BranchData, LeafData> BaseNode for SplitNodeDeque<BranchData, LeafData>
impl<BranchData, LeafData> BaseNode for SplitNodeDeque<BranchData, LeafData>
Source§type Representation = SplitNodeRepresentation<BranchData, LeafData>
type Representation = SplitNodeRepresentation<BranchData, LeafData>
Source§type Branch = BranchDeque<BranchData, LeafData>
type Branch = BranchDeque<BranchData, LeafData>
The type used for branch nodes. Read more
Source§fn into_representation(self, arena: &mut Arena<Self>) -> Self::Representationwhere
Self: Sized,
fn into_representation(self, arena: &mut Arena<Self>) -> Self::Representationwhere
Self: Sized,
Converts this node into its representation. Read more
Source§impl<BranchData: Debug + Debug, LeafData: Debug + Debug> Debug for SplitNodeDeque<BranchData, LeafData>
impl<BranchData: Debug + Debug, LeafData: Debug + Debug> Debug for SplitNodeDeque<BranchData, LeafData>
Source§impl<BranchData, LeafData> Node for SplitNodeDeque<BranchData, LeafData>
impl<BranchData, LeafData> Node for SplitNodeDeque<BranchData, LeafData>
Source§type Token = SplitTokenDeque<BranchData, LeafData>
type Token = SplitTokenDeque<BranchData, LeafData>
The token associated with this type of node.
Source§type DataRef<'data> = SplitData<&'data BranchData, &'data LeafData>
where
Self: 'data
type DataRef<'data> = SplitData<&'data BranchData, &'data LeafData> where Self: 'data
Source§type DataRefMut<'data> = SplitData<&'data mut BranchData, &'data mut LeafData>
where
Self: 'data
type DataRefMut<'data> = SplitData<&'data mut BranchData, &'data mut LeafData> where Self: 'data
Source§fn data(&self) -> Self::DataRef<'_>
fn data(&self) -> Self::DataRef<'_>
Returns a reference to the data associated with this node.
Source§fn data_mut(&mut self) -> Self::DataRefMut<'_>
fn data_mut(&mut self) -> Self::DataRefMut<'_>
Returns a mutable reference to the data associated with this node.
Source§impl<BranchData, LeafData> NodeToken<SplitNodeDeque<BranchData, LeafData>> for SplitTokenDeque<BranchData, LeafData>
impl<BranchData, LeafData> NodeToken<SplitNodeDeque<BranchData, LeafData>> for SplitTokenDeque<BranchData, LeafData>
Source§fn parent(
&self,
arena: &Arena<N::Base>,
) -> Option<<<N::Base as BaseNode>::Branch as Node>::Token>
fn parent( &self, arena: &Arena<N::Base>, ) -> Option<<<N::Base as BaseNode>::Branch as Node>::Token>
Source§fn ancestors<'arena>(
&self,
arena: &'arena Arena<N::Base>,
) -> Ancestors<'arena, N::Base> ⓘ
fn ancestors<'arena>( &self, arena: &'arena Arena<N::Base>, ) -> Ancestors<'arena, N::Base> ⓘ
Source§impl<'node, BranchData, LeafData> TryFrom<&'node SplitNodeDeque<BranchData, LeafData>> for &'node BranchDeque<BranchData, LeafData>
impl<'node, BranchData, LeafData> TryFrom<&'node SplitNodeDeque<BranchData, LeafData>> for &'node BranchDeque<BranchData, LeafData>
Source§type Error = &'node SplitNodeDeque<BranchData, LeafData>
type Error = &'node SplitNodeDeque<BranchData, LeafData>
The type returned in the event of a conversion error.
Source§impl<'node, BranchData, LeafData> TryFrom<&'node SplitNodeDeque<BranchData, LeafData>> for &'node LeafDeque<BranchData, LeafData>
impl<'node, BranchData, LeafData> TryFrom<&'node SplitNodeDeque<BranchData, LeafData>> for &'node LeafDeque<BranchData, LeafData>
Source§type Error = &'node SplitNodeDeque<BranchData, LeafData>
type Error = &'node SplitNodeDeque<BranchData, LeafData>
The type returned in the event of a conversion error.
Source§impl<'node, BranchData, LeafData> TryFrom<&'node mut SplitNodeDeque<BranchData, LeafData>> for &'node mut BranchDeque<BranchData, LeafData>
impl<'node, BranchData, LeafData> TryFrom<&'node mut SplitNodeDeque<BranchData, LeafData>> for &'node mut BranchDeque<BranchData, LeafData>
Source§type Error = &'node mut SplitNodeDeque<BranchData, LeafData>
type Error = &'node mut SplitNodeDeque<BranchData, LeafData>
The type returned in the event of a conversion error.
Source§impl<'node, BranchData, LeafData> TryFrom<&'node mut SplitNodeDeque<BranchData, LeafData>> for &'node mut LeafDeque<BranchData, LeafData>
impl<'node, BranchData, LeafData> TryFrom<&'node mut SplitNodeDeque<BranchData, LeafData>> for &'node mut LeafDeque<BranchData, LeafData>
Source§type Error = &'node mut SplitNodeDeque<BranchData, LeafData>
type Error = &'node mut SplitNodeDeque<BranchData, LeafData>
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl<BranchData, LeafData> Freeze for SplitNodeDeque<BranchData, LeafData>
impl<BranchData, LeafData> RefUnwindSafe for SplitNodeDeque<BranchData, LeafData>where
BranchData: RefUnwindSafe,
LeafData: RefUnwindSafe,
impl<BranchData, LeafData> Send for SplitNodeDeque<BranchData, LeafData>
impl<BranchData, LeafData> Sync for SplitNodeDeque<BranchData, LeafData>
impl<BranchData, LeafData> Unpin for SplitNodeDeque<BranchData, LeafData>
impl<BranchData, LeafData> UnwindSafe for SplitNodeDeque<BranchData, LeafData>where
BranchData: UnwindSafe,
LeafData: 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