Trait RessProtocolProvider

Source
pub trait RessProtocolProvider: Send + Sync {
    // Required methods
    fn header(&self, block_hash: B256) -> ProviderResult<Option<Header>>;
    fn block_body(&self, block_hash: B256) -> ProviderResult<Option<BlockBody>>;
    fn bytecode(&self, code_hash: B256) -> ProviderResult<Option<Bytes>>;
    fn witness(
        &self,
        block_hash: B256,
    ) -> impl Future<Output = ProviderResult<Vec<Bytes>>> + Send;

    // Provided methods
    fn headers(&self, request: GetHeaders) -> ProviderResult<Vec<Header>> { ... }
    fn block_bodies(
        &self,
        block_hashes: Vec<B256>,
    ) -> ProviderResult<Vec<BlockBody>> { ... }
}
Expand description

A provider trait for ress protocol.

Required Methods§

Source

fn header(&self, block_hash: B256) -> ProviderResult<Option<Header>>

Return block header by hash.

Source

fn block_body(&self, block_hash: B256) -> ProviderResult<Option<BlockBody>>

Return block body by hash.

Source

fn bytecode(&self, code_hash: B256) -> ProviderResult<Option<Bytes>>

Return bytecode by code hash.

Source

fn witness( &self, block_hash: B256, ) -> impl Future<Output = ProviderResult<Vec<Bytes>>> + Send

Return witness by block hash.

Provided Methods§

Source

fn headers(&self, request: GetHeaders) -> ProviderResult<Vec<Header>>

Return block headers.

Source

fn block_bodies( &self, block_hashes: Vec<B256>, ) -> ProviderResult<Vec<BlockBody>>

Return block bodies.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§