Skip to main content

BalanceTreeNode

Struct BalanceTreeNode 

Source
pub struct BalanceTreeNode<'ctx> {
    pub account: AccountTreeKey<'ctx>,
    pub depth: u16,
    pub self_amount: Amount<'ctx>,
    pub subtree_amount: Amount<'ctx>,
    /* private fields */
}
Expand description

Node of the each element.

Fields§

§account: AccountTreeKey<'ctx>

Account key of this node (AccountTreeKey::Root for the synthetic root).

§depth: u16

Depth in the tree: root is 0, its children 1, and so on.

§self_amount: Amount<'ctx>

Amount of the node itself, excluding descendants.

§subtree_amount: Amount<'ctx>

Amount of the node and all its descendants.

Implementations§

Source§

impl<'ctx> BalanceTreeNode<'ctx>

Source

pub fn has_children(&self) -> bool

Returns true when the node has at least one child.

Source

pub fn subtree_range(&self) -> Range<usize> ⓘ

Range of this node and all its descendants in BalanceTree::nodes.

The node itself is at range.start; its descendants (if any) occupy range.start + 1 .. range.end.

Trait Implementations§

Source§

impl<'ctx> Debug for BalanceTreeNode<'ctx>

Source§

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

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

impl<'ctx> Eq for BalanceTreeNode<'ctx>

Source§

impl<'ctx> PartialEq for BalanceTreeNode<'ctx>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'ctx> StructuralPartialEq for BalanceTreeNode<'ctx>

Auto Trait Implementations§

§

impl<'ctx> Freeze for BalanceTreeNode<'ctx>

§

impl<'ctx> RefUnwindSafe for BalanceTreeNode<'ctx>

§

impl<'ctx> Send for BalanceTreeNode<'ctx>

§

impl<'ctx> Sync for BalanceTreeNode<'ctx>

§

impl<'ctx> Unpin for BalanceTreeNode<'ctx>

§

impl<'ctx> UnsafeUnpin for BalanceTreeNode<'ctx>

§

impl<'ctx> UnwindSafe for BalanceTreeNode<'ctx>

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.