[][src]Struct exonum_explorer::BlockInfo

pub struct BlockInfo<'a> { /* fields omitted */ }

Information about a block in the blockchain.

JSON presentation

JSON object with the following fields:

NameEquivalent typeDescription
blockBlockBlock header as recorded in the blockchain
precommitsVec<Precommit>Precommits authorizing the block
txsVec<Hash>Hashes of transactions in the block

Methods

impl<'a> BlockInfo<'a>[src]

pub fn header(&self) -> &Block[src]

Returns block header as recorded in the blockchain.

pub fn into_header(self) -> Block[src]

Extracts the header discarding all other information.

pub fn height(&self) -> Height[src]

Returns the height of this block.

This method is equivalent to calling block.header().height().

pub fn len(&self) -> usize[src]

Returns the number of transactions in this block.

pub fn is_empty(&self) -> bool[src]

Is this block empty (i.e., contains no transactions)?

pub fn precommits(&self) -> Ref<[Verified<Precommit>]>[src]

Returns a list of precommits for this block.

pub fn transaction_hashes(&self) -> Ref<[Hash]>[src]

Lists hashes of transactions included in this block.

pub fn transaction(&self, index: usize) -> Option<CommittedTransaction>[src]

Returns a transaction with the specified index in the block.

pub fn call_proof(&self, call_location: CallInBlock) -> CallProof[src]

Returns the proof for the execution status of a call within this block.

Note that if the call did not result in an error or did not happen at all, the returned proof will not contain entries. To distinguish between two cases, one can inspect the number of transactions in the block or IDs of the active services when the block was executed.

pub fn iter(&self) -> Transactions[src]

Iterates over transactions in the block.

pub fn with_transactions(self) -> BlockWithTransactions[src]

Loads transactions, errors and precommits for the block.

Trait Implementations

impl<'a> Debug for BlockInfo<'a>[src]

impl<'_> From<BlockInfo<'_>> for BlockInfo[src]

impl<'a, 'r: 'a> IntoIterator for &'r BlockInfo<'a>[src]

type Item = CommittedTransaction

The type of the elements being iterated over.

type IntoIter = Transactions<'a, 'r>

Which kind of iterator are we turning this into?

impl<'a> Serialize for BlockInfo<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for BlockInfo<'a>

impl<'a> Send for BlockInfo<'a>

impl<'a> !Sync for BlockInfo<'a>

impl<'a> Unpin for BlockInfo<'a>

impl<'a> !UnwindSafe for BlockInfo<'a>

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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<V, T> VZip<V> for T where
    V: MultiLane<T>,