pub fn block_at_slot(
        &self,
        slot: Slot,
    ) -> Result<Option<SignedBeaconBlock<T::EthSpec>>, Error> {
        let root = process_results(self.rev_iter_block_roots()?, |mut iter| {
            iter.find(|(_, this_slot)| *this_slot == slot)
                .map(|(root, _)| root)
        })?;

        if let Some(block_root) = root {
            Ok(self.store.get_item(&block_root)?)
        } else {
            Ok(None)
        }
    }
/// Returns the block at the given slot, if any. Only returns blocks in the canonical chain.
///
/// ## Errors
///
/// May return a database error.
Returns the block at the given slot, if any. Only returns blocks in the canonical chain.
Returns the block at the given slot if any . Only returns blocks in the canonical chain .
pub fn block_at_slot(
        &self,
        slot: Slot,
    ) -> Result<Option<SignedBeaconBlock<T::EthSpec>>, Error> {
        let root = process_results(self.rev_iter_block_roots()?, |mut iter| {
            iter.find(|(_, this_slot)| *this_slot == slot)
                .map(|(root, _)| root)
        })?;
        if let Some(block_root) = root {
            Ok(self.store.get_item(&block_root)?)
        } else {
            Ok(None)
        }
    }
pub fn block_at_slot ( & self , slot : Slot , ) -> Result < Option < SignedBeaconBlock < T :: EthSpec > > , Error > { let root = process_results ( self . rev_iter_block_roots ( ) ? , | mut iter | { iter . find ( | ( _ , this_slot ) | * this_slot == slot ) . map ( | ( root , _ ) | root ) } ) ? ; if let Some ( block_root ) = root { Ok ( self . store . get_item ( & block_root ) ? ) } else { Ok ( None ) } }
Returns the block at the given slot, if any.
Returns the block at the given slot if any .
&self
slot
Slot
errors
May return a database error.
May return a database error .