pub trait Transport:
Send
+ Sync
+ 'static {
// Required methods
fn send_request<'life0, 'life1, 'async_trait>(
&'life0 self,
r: Request<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn send_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
rs: &'life1 [Request<'life2>],
) -> Pin<Box<dyn Future<Output = Result<Vec<Response>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
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<'life0, 'life1, 'async_trait>(
&'life0 self,
r: Request<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_request<'life0, 'life1, 'async_trait>(
&'life0 self,
r: Request<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send an RPC request over the transport.
Sourcefn send_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
rs: &'life1 [Request<'life2>],
) -> Pin<Box<dyn Future<Output = Result<Vec<Response>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
rs: &'life1 [Request<'life2>],
) -> Pin<Box<dyn Future<Output = Result<Vec<Response>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send a batch of RPC requests over the transport.
Sourcefn fmt_target(&self, f: &mut Formatter<'_>) -> Result
fn fmt_target(&self, f: &mut Formatter<'_>) -> Result
Format the target of this transport. I.e. the URL/socket/…