[][src]Trait web3::Transport

pub trait Transport: Debug + Clone {
    type Out: Future<Output = Result<Value>>;
    fn prepare(&self, method: &str, params: Vec<Value>) -> (RequestId, Call);
fn send(&self, id: RequestId, request: Call) -> Self::Out; fn execute(&self, method: &str, params: Vec<Value>) -> Self::Out { ... } }

Transport implementation

Associated Types

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

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

Loading content...

Required methods

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

Prepare serializable RPC call for given method with parameters.

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

Execute prepared RPC call.

Loading content...

Provided methods

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

Execute remote method with given parameters.

Loading content...

Implementors

impl Transport for Http[src]

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

impl Transport for WebSocket[src]

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

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

type Out = BoxFuture<'static, Result<Value>>

impl<T> Transport for Batch<T> where
    T: BatchTransport
[src]

type Out = SingleResult

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

type Out = T::Out

Loading content...