Skip to main content

LevelTree

Trait LevelTree 

Source
pub trait LevelTree: Tree {
    // Required methods
    fn level_ancestor(
        &self,
        node: Self::NodeHandle,
        level: u64,
    ) -> Option<Self::NodeHandle>;
    fn level_next(&self, node: Self::NodeHandle) -> Option<Self::NodeHandle>;
    fn level_prev(&self, node: Self::NodeHandle) -> Option<Self::NodeHandle>;
    fn level_leftmost(&self, level: u64) -> Option<Self::NodeHandle>;
    fn level_rightmost(&self, level: u64) -> Option<Self::NodeHandle>;
}
Expand description

A trait for succinct tree data structures that support level-order traversal.

Required Methods§

Source

fn level_ancestor( &self, node: Self::NodeHandle, level: u64, ) -> Option<Self::NodeHandle>

Returns the level’th ancestor of the given node, if it exists. If the level is 0, node is returned. If node is not a valid node handle, the result is meaningless.

Source

fn level_next(&self, node: Self::NodeHandle) -> Option<Self::NodeHandle>

Returns the next node in the level order traversal of the tree, if it exists.

Source

fn level_prev(&self, node: Self::NodeHandle) -> Option<Self::NodeHandle>

Returns the previous node in the level order traversal of the tree, if it exists.

Source

fn level_leftmost(&self, level: u64) -> Option<Self::NodeHandle>

Returns the leftmost node at the given level, if it exists.

Source

fn level_rightmost(&self, level: u64) -> Option<Self::NodeHandle>

Returns the rightmost node at the given level, if it exists.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<const BLOCK_SIZE: usize> LevelTree for BpTree<BLOCK_SIZE>