[][src]Struct exonum_explorer::BlockWithTransactions

#[non_exhaustive]pub struct BlockWithTransactions {
    pub header: Block,
    pub precommits: Vec<Verified<Precommit>>,
    pub transactions: Vec<CommittedTransaction>,
    pub errors: Vec<ErrorWithLocation>,
}

Information about a block in the blockchain with info on transactions eagerly loaded.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
header: Block

Block header as recorded in the blockchain.

precommits: Vec<Verified<Precommit>>

Precommits.

transactions: Vec<CommittedTransaction>

Transactions in the order they appear in the block.

errors: Vec<ErrorWithLocation>

Errors that have occurred within the block.

Methods

impl BlockWithTransactions[src]

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 iter(&self) -> EagerTransactions[src]

Iterates over transactions in the block.

pub fn error_map(&self) -> BTreeMap<CallInBlock, &ExecutionError>[src]

Returns errors converted into a map. Note that this is potentially a costly operation.

Trait Implementations

impl Debug for BlockWithTransactions[src]

impl<'de> Deserialize<'de> for BlockWithTransactions[src]

impl Index<Hash> for BlockWithTransactions[src]

Returns a transaction in the block by its hash. Beware that this is a slow operation (linear w.r.t. the number of transactions in a block).

type Output = CommittedTransaction

The returned type after indexing.

impl Index<usize> for BlockWithTransactions[src]

type Output = CommittedTransaction

The returned type after indexing.

impl<'a> IntoIterator for &'a BlockWithTransactions[src]

type Item = &'a CommittedTransaction

The type of the elements being iterated over.

type IntoIter = EagerTransactions<'a>

Which kind of iterator are we turning this into?

impl Serialize for BlockWithTransactions[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[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>,