Trait BlockHash

Source
pub trait BlockHash {
    type Error: StdError;

    // Required method
    fn block_hash(&mut self, number: u64) -> Result<B256, Self::Error>;
}
Expand description

Trait for mutable access to block hash data. This is typically used for database implementations that may cache or lazily load block hashes.

Required Associated Types§

Source

type Error: StdError

Error type for block hash operations

Required Methods§

Source

fn block_hash(&mut self, number: u64) -> Result<B256, Self::Error>

Gets block hash by block number.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + BlockHash + ?Sized> BlockHash for &'a mut T

Source§

type Error = <T as BlockHash>::Error

Source§

fn block_hash(&mut self, number: u64) -> Result<B256, Self::Error>

Source§

impl<T> BlockHash for &T
where T: BlockHashRef,

Source§

type Error = <T as BlockHashRef>::Error

Source§

fn block_hash(&mut self, number: u64) -> Result<B256, Self::Error>

Source§

impl<T> BlockHash for Arc<T>
where T: BlockHashRef,

Source§

type Error = <T as BlockHashRef>::Error

Source§

fn block_hash(&mut self, number: u64) -> Result<B256, Self::Error>

Source§

impl<T: BlockHash + ?Sized> BlockHash for Box<T>

Source§

type Error = <T as BlockHash>::Error

Source§

fn block_hash(&mut self, number: u64) -> Result<B256, Self::Error>

Implementors§