pub struct Leaf<BranchData: Debug, LeafData: Debug> { /* private fields */ }
Available on crate feature split only.
Expand description

The node representing leaves in a split node tree.

Leaves are nodes which may not have children, as opposed to branches, which may have children.

[LeafData] represents the custom data associated with leaf nodes.

Trait Implementations§

source§

impl<BranchData: Debug + Debug, LeafData: Debug + Debug> Debug for Leaf<BranchData, LeafData>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<BranchData, LeafData> Hash for Leaf<BranchData, LeafData>
where BranchData: Debug, LeafData: Debug,

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<BranchData, LeafData> LinkedNode for Leaf<BranchData, LeafData>
where BranchData: Debug, LeafData: Debug,

source§

fn prev(&self) -> Option<<Self::Base as Node>::Token>

Returns the token of this node’s previous sibling. Read more
source§

fn next(&self) -> Option<<Self::Base as Node>::Token>

Returns the token of this node’s next sibling. Read more
source§

fn preceding_siblings<'node>( &'node self, arena: &'node Arena<Self::Base> ) -> PrecedingSiblings<'node, Self>
where Self: Sized,

Returns an iterator over the tokens of this node’s preceding siblings. Read more
source§

fn following_siblings<'node>( &'node self, arena: &'node Arena<Self::Base> ) -> FollowingSiblings<'node, Self>
where Self: Sized,

Returns an iterator over the tokens of this node’s following siblings. Read more
source§

impl<BranchData, LeafData> Node for Leaf<BranchData, LeafData>
where BranchData: Debug, LeafData: Debug,

§

type Base = SplitNode<BranchData, LeafData>

The ‘base node’ used in the arena. Read more
§

type Token = Token<Leaf<BranchData, LeafData>> where Self: Sized

The token associated with this type of node.
§

type Data = LeafData

The custom data associated with this node.
§

type DataRef<'data> = &'data LeafData where Self: 'data

A type acting as a reference to the node’s data. Read more
§

type DataRefMut<'data> = &'data mut LeafData where Self: 'data

A type acting as a mutable reference to the node’s data. Read more
source§

fn new(arena: &mut Arena<Self::Base>, data: Self::Data) -> Token<Self>
where Self: Sized,

Creates a new node allocated in the given arena using the given data. Read more
source§

fn token(&self) -> Self::Token
where Self: Sized,

Returns this node’s token.
source§

fn parent(&self) -> Option<Token<<Self::Base as BaseNode>::Branch>>

Returns the token of this node’s parent. Read more
source§

fn data(&self) -> Self::DataRef<'_>

Returns a reference to the data associated with this node.
source§

fn data_mut(&mut self) -> Self::DataRefMut<'_>

Returns a mutable reference to the data associated with this node.
source§

fn ancestors<'node>( &'node self, arena: &'node Arena<Self::Base> ) -> Ancestors<'node, Self::Base>
where Self: Sized,

Returns an iterator over the tokens of this node’s ancestors. Read more
source§

fn root<'node>(&'node self, arena: &'node Arena<Self::Base>) -> RootToken<Self>
where Self: Sized,

Returns this node’s root node. Read more
source§

impl<BranchData, LeafData> PartialEq for Leaf<BranchData, LeafData>
where BranchData: Debug, LeafData: Debug,

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'node, BranchData, LeafData> TryFrom<&'node SplitNode<BranchData, LeafData>> for &'node Leaf<BranchData, LeafData>
where BranchData: Debug, LeafData: Debug,

§

type Error = &'node SplitNode<BranchData, LeafData>

The type returned in the event of a conversion error.
source§

fn try_from( node: &'node SplitNode<BranchData, LeafData> ) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'node, BranchData, LeafData> TryFrom<&'node mut SplitNode<BranchData, LeafData>> for &'node mut Leaf<BranchData, LeafData>
where BranchData: Debug, LeafData: Debug,

§

type Error = &'node mut SplitNode<BranchData, LeafData>

The type returned in the event of a conversion error.
source§

fn try_from( node: &'node mut SplitNode<BranchData, LeafData> ) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<BranchData, LeafData> Eq for Leaf<BranchData, LeafData>
where BranchData: Debug, LeafData: Debug,

Auto Trait Implementations§

§

impl<BranchData, LeafData> RefUnwindSafe for Leaf<BranchData, LeafData>
where BranchData: RefUnwindSafe, LeafData: RefUnwindSafe,

§

impl<BranchData, LeafData> Send for Leaf<BranchData, LeafData>
where BranchData: Send, LeafData: Send,

§

impl<BranchData, LeafData> Sync for Leaf<BranchData, LeafData>
where BranchData: Sync, LeafData: Sync,

§

impl<BranchData, LeafData> Unpin for Leaf<BranchData, LeafData>
where BranchData: Unpin, LeafData: Unpin,

§

impl<BranchData, LeafData> UnwindSafe for Leaf<BranchData, LeafData>
where BranchData: UnwindSafe, LeafData: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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