Trait jsonrpc_client_core::Transport
[−]
[src]
pub trait Transport: Clone + Send + 'static { type Error: Error + Send + 'static; fn get_next_id(&mut self) -> u64; fn send(&self, json_data: Vec<u8>) -> BoxFuture<Vec<u8>, Self::Error>; }
Trait for types acting as a transport layer for the JSON-RPC 2.0 clients generated by the
jsonrpc_client macro.
Associated Types
Required Methods
fn get_next_id(&mut self) -> u64
Returns an id that has not yet been used on this transport. Used by the RPC clients to fill in the "id" field of a request.
fn send(&self, json_data: Vec<u8>) -> BoxFuture<Vec<u8>, Self::Error>
Sends the given data over the transport and returns a future that will complete with the response to the request, or the transport specific error if something went wrong.