near_fetch::query

Trait ProcessQuery

source
pub trait ProcessQuery {
    type Method: RpcMethod;
    type Output;

    // Required methods
    fn into_request(self, block_ref: BlockReference) -> Result<Self::Method>;
    fn from_response(
        resp: <Self::Method as RpcMethod>::Response,
    ) -> Result<Self::Output>;
}
Expand description

Trait used as a high level APIs for consistent usages of block reference. Mostly used internally to facilitate syntax sugar for performing RPC requests with async builders.

Required Associated Types§

source

type Method: RpcMethod

Method for doing the internal RPC request to the network of our choosing.

source

type Output

Expected output after performing a query.

Required Methods§

source

fn into_request(self, block_ref: BlockReference) -> Result<Self::Method>

Convert into the Request object that is required to perform the RPC request.

source

fn from_response( resp: <Self::Method as RpcMethod>::Response, ) -> Result<Self::Output>

Convert the response from the RPC request to a type of our choosing.

Object Safety§

This trait is not object safe.

Implementors§