Trait web3::Transport [−][src]
pub trait Transport: Debug + Clone { type Out: Future<Item = Value, Error = Error>; 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<Item = Value, Error = Error>
The type of future this transport returns when a call is made.
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.
Provided Methods
fn execute(&self, method: &str, params: Vec<Value>) -> Self::Out
Execute remote method with given parameters.
Implementors
impl<T> Transport for Batch<T> where
T: BatchTransport, type Out = SingleResult;impl Transport for Http type Out = FetchTask<fn(_: Chunk) -> Result<Value>>;
impl Transport for Ipc type Out = IpcTask<fn(_: Vec<Result<Value>>) -> Result<Value>>;
impl Transport for WebSocket type Out = WsTask<fn(_: Vec<Result<Value>>) -> Result<Value>>;
impl<X, T: ?Sized> Transport for X where
T: Transport,
X: Deref<Target = T>,
X: Debug,
X: Clone, type Out = T::Out;