[][src]Struct store::iter::BlockRootsIterator

pub struct BlockRootsIterator<'a, T: EthSpec, U> { /* fields omitted */ }

Iterates backwards through block roots. If any specified slot is unable to be retrieved, the iterator returns None indefinitely.

Uses the block_roots field of BeaconState to as the source of block roots and will perform a lookup on the Store for a prior BeaconState if block_roots has been exhausted.

Returns None for roots prior to genesis or when there is an error reading from Store.

Methods

impl<'a, T: EthSpec, U: Store> BlockRootsIterator<'a, T, U>[src]

pub fn new(store: Arc<U>, beacon_state: &'a BeaconState<T>) -> Self[src]

Create a new iterator over all block roots in the given beacon_state and prior states.

pub fn owned(store: Arc<U>, beacon_state: BeaconState<T>) -> Self[src]

Create a new iterator over all block roots in the given beacon_state and prior states.

Trait Implementations

impl<'a, U: Store, E: EthSpec> AncestorIter<U, BlockRootsIterator<'a, E, U>> for BeaconBlock<E>[src]

fn try_iter_ancestor_roots(
    &self,
    store: Arc<U>
) -> Option<BlockRootsIterator<'a, E, U>>
[src]

Iterates across all available prior block roots of self, starting at the most recent and ending at genesis.

impl<'a, T: Clone + EthSpec, U: Clone> Clone for BlockRootsIterator<'a, T, U>[src]

impl<'a, T: EthSpec, U: Store> Iterator for BlockRootsIterator<'a, T, U>[src]

type Item = (Hash256, Slot)

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a, T, U> Send for BlockRootsIterator<'a, T, U> where
    U: Send + Sync,
    <T as EthSpec>::EpochsPerHistoricalVector: Clone + Send + Sync,
    <T as EthSpec>::EpochsPerSlashingsVector: Clone + Send + Sync,
    <T as EthSpec>::HistoricalRootsLimit: Clone + Send + Sync,
    <T as EthSpec>::JustificationBitsLength: Clone + Send + Sync,
    <T as EthSpec>::MaxPendingAttestations: Clone + Send + Sync,
    <T as EthSpec>::MaxValidatorsPerCommittee: Send + Sync,
    <T as EthSpec>::ShardCount: Clone + Send + Sync,
    <T as EthSpec>::SlotsPerEth1VotingPeriod: Clone + Send + Sync,
    <T as EthSpec>::SlotsPerHistoricalRoot: Clone + Send + Sync,
    <T as EthSpec>::ValidatorRegistryLimit: Clone + Send + Sync

impl<'a, T, U> Unpin for BlockRootsIterator<'a, T, U> where
    <T as EthSpec>::EpochsPerHistoricalVector: Clone + Unpin,
    <T as EthSpec>::EpochsPerSlashingsVector: Clone + Unpin,
    <T as EthSpec>::HistoricalRootsLimit: Clone + Unpin,
    <T as EthSpec>::JustificationBitsLength: Clone + Unpin,
    <T as EthSpec>::MaxPendingAttestations: Clone + Unpin,
    <T as EthSpec>::MaxValidatorsPerCommittee: Unpin,
    <T as EthSpec>::ShardCount: Clone + Unpin,
    <T as EthSpec>::SlotsPerEth1VotingPeriod: Clone + Unpin,
    <T as EthSpec>::SlotsPerHistoricalRoot: Clone + Unpin,
    <T as EthSpec>::ValidatorRegistryLimit: Clone + Unpin

impl<'a, T, U> Sync for BlockRootsIterator<'a, T, U> where
    U: Send + Sync,
    <T as EthSpec>::EpochsPerHistoricalVector: Clone + Sync,
    <T as EthSpec>::EpochsPerSlashingsVector: Clone + Sync,
    <T as EthSpec>::HistoricalRootsLimit: Clone + Sync,
    <T as EthSpec>::JustificationBitsLength: Clone + Sync,
    <T as EthSpec>::MaxPendingAttestations: Clone + Sync,
    <T as EthSpec>::MaxValidatorsPerCommittee: Sync,
    <T as EthSpec>::ShardCount: Clone + Sync,
    <T as EthSpec>::SlotsPerEth1VotingPeriod: Clone + Sync,
    <T as EthSpec>::SlotsPerHistoricalRoot: Clone + Sync,
    <T as EthSpec>::ValidatorRegistryLimit: Clone + Sync

impl<'a, T, U> UnwindSafe for BlockRootsIterator<'a, T, U> where
    U: RefUnwindSafe,
    <T as EthSpec>::EpochsPerHistoricalVector: Clone + RefUnwindSafe + UnwindSafe,
    <T as EthSpec>::EpochsPerSlashingsVector: Clone + RefUnwindSafe + UnwindSafe,
    <T as EthSpec>::HistoricalRootsLimit: Clone + RefUnwindSafe + UnwindSafe,
    <T as EthSpec>::JustificationBitsLength: Clone + RefUnwindSafe + UnwindSafe,
    <T as EthSpec>::MaxPendingAttestations: Clone + RefUnwindSafe + UnwindSafe,
    <T as EthSpec>::MaxValidatorsPerCommittee: RefUnwindSafe + UnwindSafe,
    <T as EthSpec>::ShardCount: Clone + RefUnwindSafe + UnwindSafe,
    <T as EthSpec>::SlotsPerEth1VotingPeriod: Clone + RefUnwindSafe + UnwindSafe,
    <T as EthSpec>::SlotsPerHistoricalRoot: Clone + RefUnwindSafe + UnwindSafe,
    <T as EthSpec>::ValidatorRegistryLimit: Clone + RefUnwindSafe + UnwindSafe

impl<'a, T, U> RefUnwindSafe for BlockRootsIterator<'a, T, U> where
    U: RefUnwindSafe,
    <T as EthSpec>::EpochsPerHistoricalVector: Clone + RefUnwindSafe,
    <T as EthSpec>::EpochsPerSlashingsVector: Clone + RefUnwindSafe,
    <T as EthSpec>::HistoricalRootsLimit: Clone + RefUnwindSafe,
    <T as EthSpec>::JustificationBitsLength: Clone + RefUnwindSafe,
    <T as EthSpec>::MaxPendingAttestations: Clone + RefUnwindSafe,
    <T as EthSpec>::MaxValidatorsPerCommittee: RefUnwindSafe,
    <T as EthSpec>::ShardCount: Clone + RefUnwindSafe,
    <T as EthSpec>::SlotsPerEth1VotingPeriod: Clone + RefUnwindSafe,
    <T as EthSpec>::SlotsPerHistoricalRoot: Clone + RefUnwindSafe,
    <T as EthSpec>::ValidatorRegistryLimit: Clone + RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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]

impl<I> IteratorRandom for I where
    I: Iterator
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized

impl<T> ParallelBridge for T where
    T: Send + Iterator,
    <T as Iterator>::Item: Send
[src]