[][src]Struct blockchain::backend::TreeRoute

pub struct TreeRoute<B: Block> { /* fields omitted */ }

A tree-route from one block to another in the chain.

All blocks prior to the pivot in the deque is the reverse-order unique ancestry of the first block, the block at the pivot index is the common ancestor, and all blocks after the pivot is the ancestry of the second block, in order.

The ancestry sets will include the given blocks, and thus the tree-route is never empty.

Tree route from R1 to E2. Retracted is [R1, R2, R3], Common is C, enacted [E1, E2]
  <- R3 <- R2 <- R1
 /
C
 \-> E1 -> E2
Tree route from C to E2. Retracted empty. Common is C, enacted [E1, E2]
C -> E1 -> E2

Methods

impl<B: Block> TreeRoute<B>[src]

pub fn retracted(&self) -> &[B::Identifier][src]

Get a slice of all retracted blocks in reverse order (towards common ancestor)

pub fn common_block(&self) -> &B::Identifier[src]

Get the common ancestor block. This might be one of the two blocks of the route.

pub fn enacted(&self) -> &[B::Identifier][src]

Get a slice of enacted blocks (descendents of the common ancestor)

Auto Trait Implementations

impl<B> Send for TreeRoute<B> where
    <B as Block>::Identifier: Send

impl<B> Sync for TreeRoute<B> where
    <B as Block>::Identifier: Sync

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]