Struct bao_tree::iter::NodeInfo

source ·
pub struct NodeInfo<'a> {
    pub node: TreeNode,
    pub is_root: bool,
    pub ranges: &'a ChunkRangesRef,
    pub l_ranges: &'a ChunkRangesRef,
    pub r_ranges: &'a ChunkRangesRef,
    pub full: bool,
    pub query_leaf: bool,
    pub is_half_leaf: bool,
}
Expand description

Extended node info.

Some of the information is redundant, but it is convenient to have it all in one place.

Usually this is used within an iterator, so we hope that the compiler will optimize away the redundant information.

Fields§

§node: TreeNode

the node

§is_root: bool

the node is the root node (needs special handling when computing hash)

§ranges: &'a ChunkRangesRef

ranges of the node and it’s two children

§l_ranges: &'a ChunkRangesRef

left child intersection with the query range

§r_ranges: &'a ChunkRangesRef

right child intersection with the query range

§full: bool

the node is fully included in the query range

§query_leaf: bool

the node is a leaf for the purpose of this query

§is_half_leaf: bool

true if this node is the last leaf, and it is <= half full

Trait Implementations§

source§

impl<'a> Debug for NodeInfo<'a>

source§

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

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

impl<'a> PartialEq for NodeInfo<'a>

source§

fn eq(&self, other: &NodeInfo<'a>) -> 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<'a> Eq for NodeInfo<'a>

source§

impl<'a> StructuralPartialEq for NodeInfo<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for NodeInfo<'a>

§

impl<'a> Send for NodeInfo<'a>

§

impl<'a> Sync for NodeInfo<'a>

§

impl<'a> Unpin for NodeInfo<'a>

§

impl<'a> UnwindSafe for NodeInfo<'a>

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.