pub trait Transport: Send + Sync + 'static {
// Required methods
fn send_request(&self, _: Request<'_>) -> Result<Response, Error>;
fn send_batch(&self, _: &[Request<'_>]) -> Result<Vec<Response>, Error>;
fn fmt_target(&self, f: &mut Formatter<'_>) -> Result;
}
Expand description
An interface for a transport over which to use the JSONRPC protocol.
Required Methods§
sourcefn send_request(&self, _: Request<'_>) -> Result<Response, Error>
fn send_request(&self, _: Request<'_>) -> Result<Response, Error>
Sends an RPC request over the transport.
sourcefn send_batch(&self, _: &[Request<'_>]) -> Result<Vec<Response>, Error>
fn send_batch(&self, _: &[Request<'_>]) -> Result<Vec<Response>, Error>
Sends a batch of RPC requests over the transport.
sourcefn fmt_target(&self, f: &mut Formatter<'_>) -> Result
fn fmt_target(&self, f: &mut Formatter<'_>) -> Result
Formats the target of this transport. I.e. the URL/socket/…
Implementors§
impl Transport for MinreqHttpTransport
Available on crate feature
minreq_http
only.impl Transport for SimpleHttpTransport
Available on crate feature
simple_http
only.impl Transport for TcpTransport
Available on crate feature
simple_tcp
only.impl Transport for UdsTransport
Available on crate feature
simple_uds
and non-Windows only.