Trait Executor

Source
pub trait Executor: Sized {
    type Error: From<Error> + From<ApiError> + Send;

    // Required method
    fn execute<R>(
        self,
        request: R,
    ) -> impl Future<Output = (R::Discriminant, Result<ApiResponse, Self::Error>)> + Send
       where R: IntoRequest;

    // Provided method
    fn fetch<R>(
        self,
        request: R,
    ) -> impl Future<Output = Result<R::Response, Self::Error>> + Send
       where R: IntoRequest { ... }
}
Expand description

Central trait of the crate that is used to execute api requests.

Required Associated Types§

Required Methods§

Source

fn execute<R>( self, request: R, ) -> impl Future<Output = (R::Discriminant, Result<ApiResponse, Self::Error>)> + Send
where R: IntoRequest,

Execute an api request.

Provided Methods§

Source

fn fetch<R>( self, request: R, ) -> impl Future<Output = Result<R::Response, Self::Error>> + Send
where R: IntoRequest,

Execute a request and deserialise the associated response type.

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§