Skip to main content

ChainDataSourceFactory

Trait ChainDataSourceFactory 

Source
pub trait ChainDataSourceFactory:
    Send
    + Sync
    + 'static {
    type Source: ChainDataSource + 'static;

    // Required method
    fn create(&self, chain_id: u64) -> Result<Self::Source, SourceError>;

    // Provided methods
    fn supports_full_headers(&self, _chain_id: u64) -> bool { ... }
    fn supports_full_headers_on_any_chain(&self) -> bool { ... }
}
Expand description

Factory for independently configured per-chain data sources.

Required Associated Types§

Source

type Source: ChainDataSource + 'static

Source implementation produced for each managed session.

Required Methods§

Source

fn create(&self, chain_id: u64) -> Result<Self::Source, SourceError>

Create a source for one EVM chain.

§Errors

Returns SourceError when the chain is unsupported or its provider/client configuration cannot be constructed.

Provided Methods§

Source

fn supports_full_headers(&self, _chain_id: u64) -> bool

Whether this factory can reconstruct and hash-verify complete headers on a chain.

Source

fn supports_full_headers_on_any_chain(&self) -> bool

Whether any configured chain supports complete hash-verified headers.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§