[][src]Trait sc_service::client::light::fetcher::Fetcher

pub trait Fetcher<Block>: Send + Sync where
    Block: Block,
    <Self::RemoteHeaderResult as Future>::Output == Result<<Block as Block>::Header, Error>,
    <Self::RemoteReadResult as Future>::Output == Result<HashMap<Vec<u8>, Option<Vec<u8>>, RandomState>, Error>,
    <Self::RemoteCallResult as Future>::Output == Result<Vec<u8>, Error>,
    <Self::RemoteChangesResult as Future>::Output == Result<Vec<(<<Block as Block>::Header as Header>::Number, u32)>, Error>,
    <Self::RemoteBodyResult as Future>::Output == Result<Vec<<Block as Block>::Extrinsic>, Error>, 
{ type RemoteHeaderResult: 'static + Send + Unpin + Future; type RemoteReadResult: 'static + Send + Unpin + Future; type RemoteCallResult: 'static + Send + Unpin + Future; type RemoteChangesResult: 'static + Send + Unpin + Future; type RemoteBodyResult: 'static + Send + Unpin + Future; fn remote_header(
        &self,
        request: RemoteHeaderRequest<<Block as Block>::Header>
    ) -> Self::RemoteHeaderResult;
fn remote_read(
        &self,
        request: RemoteReadRequest<<Block as Block>::Header>
    ) -> Self::RemoteReadResult;
fn remote_read_child(
        &self,
        request: RemoteReadChildRequest<<Block as Block>::Header>
    ) -> Self::RemoteReadResult;
fn remote_call(
        &self,
        request: RemoteCallRequest<<Block as Block>::Header>
    ) -> Self::RemoteCallResult;
fn remote_changes(
        &self,
        request: RemoteChangesRequest<<Block as Block>::Header>
    ) -> Self::RemoteChangesResult;
fn remote_body(
        &self,
        request: RemoteBodyRequest<<Block as Block>::Header>
    ) -> Self::RemoteBodyResult; }

Light client data fetcher. Implementations of this trait must check if remote data is correct (see FetchedDataChecker) and return already checked data.

Associated Types

type RemoteHeaderResult: 'static + Send + Unpin + Future

Remote header future.

type RemoteReadResult: 'static + Send + Unpin + Future

Remote storage read future.

type RemoteCallResult: 'static + Send + Unpin + Future

Remote call result future.

type RemoteChangesResult: 'static + Send + Unpin + Future

Remote changes result future.

type RemoteBodyResult: 'static + Send + Unpin + Future

Remote block body result future.

Loading content...

Required methods

fn remote_header(
    &self,
    request: RemoteHeaderRequest<<Block as Block>::Header>
) -> Self::RemoteHeaderResult

Fetch remote header.

fn remote_read(
    &self,
    request: RemoteReadRequest<<Block as Block>::Header>
) -> Self::RemoteReadResult

Fetch remote storage value.

fn remote_read_child(
    &self,
    request: RemoteReadChildRequest<<Block as Block>::Header>
) -> Self::RemoteReadResult

Fetch remote storage child value.

fn remote_call(
    &self,
    request: RemoteCallRequest<<Block as Block>::Header>
) -> Self::RemoteCallResult

Fetch remote call result.

fn remote_changes(
    &self,
    request: RemoteChangesRequest<<Block as Block>::Header>
) -> Self::RemoteChangesResult

Fetch remote changes ((block number, extrinsic index)) where given key has been changed at a given blocks range.

fn remote_body(
    &self,
    request: RemoteBodyRequest<<Block as Block>::Header>
) -> Self::RemoteBodyResult

Fetch remote block body

Loading content...

Implementations on Foreign Types

impl<B> Fetcher<B> for OnDemand<B> where
    B: Block,
    <B as Block>::Header: Header
[src]

type RemoteHeaderResult = RemoteResponse<<B as Block>::Header>

type RemoteReadResult = RemoteResponse<HashMap<Vec<u8>, Option<Vec<u8>>, RandomState>>

type RemoteCallResult = RemoteResponse<Vec<u8>>

type RemoteChangesResult = RemoteResponse<Vec<(<<B as Block>::Header as Header>::Number, u32)>>

type RemoteBodyResult = RemoteResponse<Vec<<B as Block>::Extrinsic>>

Loading content...

Implementors

Loading content...