pub struct ChainBlocks<'a, B: Block> { /* private fields */ }Expand description
All blocks in the chain
Implementations§
Source§impl<B: Block<Body: BlockBody<Transaction: SignedTransaction>>> ChainBlocks<'_, B>
impl<B: Block<Body: BlockBody<Transaction: SignedTransaction>>> ChainBlocks<'_, B>
Sourcepub fn into_blocks(self) -> impl Iterator<Item = Arc<RecoveredBlock<B>>>
pub fn into_blocks(self) -> impl Iterator<Item = Arc<RecoveredBlock<B>>>
Creates a consuming iterator over all blocks in the chain with increasing block number.
Note: this always yields at least one block.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&BlockNumber, &RecoveredBlock<B>)>
pub fn iter(&self) -> impl Iterator<Item = (&BlockNumber, &RecoveredBlock<B>)>
Creates an iterator over all blocks in the chain with increasing block number.
Sourcepub fn transactions(
&self,
) -> impl Iterator<Item = &<B::Body as BlockBody>::Transaction> + '_
pub fn transactions( &self, ) -> impl Iterator<Item = &<B::Body as BlockBody>::Transaction> + '_
Returns an iterator over all transactions in the chain.
Sourcepub fn transactions_with_sender(
&self,
) -> impl Iterator<Item = (&Address, &<B::Body as BlockBody>::Transaction)> + '_
pub fn transactions_with_sender( &self, ) -> impl Iterator<Item = (&Address, &<B::Body as BlockBody>::Transaction)> + '_
Returns an iterator over all transactions and their senders.
Sourcepub fn transactions_ecrecovered(
&self,
) -> impl Iterator<Item = Recovered<<B::Body as BlockBody>::Transaction>> + '_
pub fn transactions_ecrecovered( &self, ) -> impl Iterator<Item = Recovered<<B::Body as BlockBody>::Transaction>> + '_
Returns an iterator over all [Recovered] in the blocks
Note: This clones the transactions since it is assumed this is part of a shared Chain.
Sourcepub fn transaction_hashes(&self) -> impl Iterator<Item = TxHash> + '_
pub fn transaction_hashes(&self) -> impl Iterator<Item = TxHash> + '_
Returns an iterator over all transaction hashes in the block
Sourcepub fn transaction_hashes_vec(&self) -> Vec<TxHash> ⓘ
pub fn transaction_hashes_vec(&self) -> Vec<TxHash> ⓘ
Returns all transaction hashes in a pre-allocated vector.
Sourcepub fn transaction_hashes_set(&self) -> HashSet<TxHash>
pub fn transaction_hashes_set(&self) -> HashSet<TxHash>
Returns all transaction hashes in a pre-allocated set.
Trait Implementations§
Source§impl<'a, B: Clone + Block> Clone for ChainBlocks<'a, B>
impl<'a, B: Clone + Block> Clone for ChainBlocks<'a, B>
Source§impl<'a, B: Debug + Block> Debug for ChainBlocks<'a, B>
impl<'a, B: Debug + Block> Debug for ChainBlocks<'a, B>
Source§impl<'a, B: Default + Block> Default for ChainBlocks<'a, B>
impl<'a, B: Default + Block> Default for ChainBlocks<'a, B>
impl<'a, B: Eq + Block> Eq for ChainBlocks<'a, B>
Source§impl<B: Block> IntoIterator for ChainBlocks<'_, B>
impl<B: Block> IntoIterator for ChainBlocks<'_, B>
Source§impl<'a, B: PartialEq + Block> PartialEq for ChainBlocks<'a, B>
impl<'a, B: PartialEq + Block> PartialEq for ChainBlocks<'a, B>
impl<'a, B: PartialEq + Block> StructuralPartialEq for ChainBlocks<'a, B>
Auto Trait Implementations§
impl<'a, B> Freeze for ChainBlocks<'a, B>
impl<'a, B> RefUnwindSafe for ChainBlocks<'a, B>
impl<'a, B> Send for ChainBlocks<'a, B>
impl<'a, B> Sync for ChainBlocks<'a, B>
impl<'a, B> Unpin for ChainBlocks<'a, B>
impl<'a, B> UnsafeUnpin for ChainBlocks<'a, B>
impl<'a, B> UnwindSafe for ChainBlocks<'a, B>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeDebug for Twhere
T: Debug,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes