pub trait Web3Transport: Debug + Clone {
    type Out: Future<Output = Result<Value, Error>>;

    // Required methods
    fn prepare(&self, method: &str, params: Vec<Value>) -> (usize, Call);
    fn send(&self, id: usize, request: Call) -> Self::Out;

    // Provided method
    fn execute(&self, method: &str, params: Vec<Value>) -> Self::Out { ... }
}
Expand description

Transport implementation

Required Associated Types§

type Out: Future<Output = Result<Value, Error>>

The type of future this transport returns when a call is made.

Required Methods§

fn prepare(&self, method: &str, params: Vec<Value>) -> (usize, Call)

Prepare serializable RPC call for given method with parameters.

fn send(&self, id: usize, request: Call) -> Self::Out

Execute prepared RPC call.

Provided Methods§

fn execute(&self, method: &str, params: Vec<Value>) -> Self::Out

Execute remote method with given parameters.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Transport for WithoutTransport

§

type Out = Pin<Box<dyn Future<Output = Result<Value, Error>> + Send>>

§

impl Transport for Http

§

type Out = Pin<Box<dyn Future<Output = Result<Value, Error>> + Send>>

§

impl Transport for Ipc

§

type Out = SingleResponse

§

impl Transport for WebSocket

§

type Out = Response<Value, fn(_: Result<Vec<Result<Value, Error>>, Error>) -> Result<Value, Error>>

§

impl<A, B, AOut, BOut> Transport for Either<A, B>
where A: Transport<Out = AOut>, B: Transport<Out = BOut>, AOut: Future<Output = Result<Value, Error>> + 'static + Send, BOut: Future<Output = Result<Value, Error>> + 'static + Send,

§

type Out = Pin<Box<dyn Future<Output = Result<Value, Error>> + Send>>

§

impl<T> Transport for Batch<T>
where T: BatchTransport,

§

type Out = SingleResult

§

impl<X, T> Transport for X
where T: Transport + ?Sized, X: Deref<Target = T> + Debug + Clone,

§

type Out = <T as Transport>::Out