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: u16Depth 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>
impl<'ctx> BalanceTreeNode<'ctx>
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Returns true when the node has at least one child.
Sourcepub fn subtree_range(&self) -> Range<usize> ⓘ
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>
impl<'ctx> Debug for BalanceTreeNode<'ctx>
impl<'ctx> Eq for BalanceTreeNode<'ctx>
Source§impl<'ctx> PartialEq for BalanceTreeNode<'ctx>
impl<'ctx> PartialEq for BalanceTreeNode<'ctx>
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> 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