#[non_exhaustive]pub struct BlockWithTransactions {
pub header: Block,
pub precommits: Vec<Verified<Precommit>>,
pub transactions: Vec<CommittedTransaction>,
pub errors: Vec<ErrorWithLocation>,
}Expand description
Information about a block in the blockchain with info on transactions eagerly loaded.
Fields (Non-exhaustive)§
This struct is marked as 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: BlockBlock 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.
Implementations§
Source§impl BlockWithTransactions
impl BlockWithTransactions
Sourcepub fn height(&self) -> Height
pub fn height(&self) -> Height
Returns the height of this block.
This method is equivalent to calling block.header.height().
Sourcepub fn iter(&self) -> EagerTransactions<'_>
pub fn iter(&self) -> EagerTransactions<'_>
Iterates over transactions in the block.
Sourcepub fn error_map(&self) -> BTreeMap<CallInBlock, &ExecutionError>
pub fn error_map(&self) -> BTreeMap<CallInBlock, &ExecutionError>
Returns errors converted into a map. Note that this is potentially a costly operation.
Trait Implementations§
Source§impl Debug for BlockWithTransactions
impl Debug for BlockWithTransactions
Source§impl<'de> Deserialize<'de> for BlockWithTransactions
impl<'de> Deserialize<'de> for BlockWithTransactions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Index<Hash> for BlockWithTransactions
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).
impl Index<Hash> for BlockWithTransactions
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).
Source§type Output = CommittedTransaction
type Output = CommittedTransaction
The returned type after indexing.
Source§impl Index<usize> for BlockWithTransactions
impl Index<usize> for BlockWithTransactions
Source§type Output = CommittedTransaction
type Output = CommittedTransaction
The returned type after indexing.
Source§impl<'a> IntoIterator for &'a BlockWithTransactions
impl<'a> IntoIterator for &'a BlockWithTransactions
Source§type Item = &'a CommittedTransaction
type Item = &'a CommittedTransaction
The type of the elements being iterated over.
Source§type IntoIter = Iter<'a, CommittedTransaction>
type IntoIter = Iter<'a, CommittedTransaction>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> EagerTransactions<'a>
fn into_iter(self) -> EagerTransactions<'a>
Creates an iterator from a value. Read more
Auto Trait Implementations§
impl Freeze for BlockWithTransactions
impl RefUnwindSafe for BlockWithTransactions
impl Send for BlockWithTransactions
impl Sync for BlockWithTransactions
impl Unpin for BlockWithTransactions
impl UnwindSafe for BlockWithTransactions
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