alloy_transport

Type Alias RpcResult

source
pub type RpcResult<T, E, ErrResp = Box<RawValue>> = Result<T, RpcError<E, ErrResp>>;
Expand description

The result of a JSON-RPC request.

Either a success response, an error response, or a non-response error. The non-response error is intended to be used for errors returned by a transport, or serde errors.

The common cases are:

  • Ok(T) - The server returned a successful response.
  • Err(RpcError::ErrorResponse(ErrResp)) - The server returned an error response.
  • Err(RpcError::SerError(E)) - A serialization error occurred.
  • Err(RpcError::DeserError { err: E, text: String }) - A deserialization error occurred.
  • Err(RpcError::TransportError(E)) - Some client-side or communication error occurred.

Aliased Type§

enum RpcResult<T, E, ErrResp = Box<RawValue>> {
    Ok(T),
    Err(RpcError<E, ErrResp>),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(RpcError<E, ErrResp>)

Contains the error value