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 converter from WorkspaceRequest to unc-rpc request, and from unc-rpc response to a WorkspaceResult. 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. This is mainly to convert over the type from unc-primitives to a workspace type.

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, mainly to conform to workspaces related types from the unc-primitives or json types from the network.

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§