Struct muxrpc::RpcOut
[−]
[src]
pub struct RpcOut<R: AsyncRead, W>(_);
Allows sending rpcs to the peer.
Methods
impl<R, W> RpcOut<R, W> where
R: AsyncRead,
W: AsyncWrite,
[src]
R: AsyncRead,
W: AsyncWrite,
pub fn async<RPC: Rpc, Res: DeserializeOwned, E: DeserializeOwned>(
&mut self,
rpc: &RPC
) -> (OutAsync<W>, InAsyncResponse<R, Res, E>)
[src]
&mut self,
rpc: &RPC
) -> (OutAsync<W>, InAsyncResponse<R, Res, E>)
Send an async request to the peer.
The OutAsync
Future must be polled to actually start sending the request.
The InAsyncResponse
Future can be polled to receive the response.
Res
is the type of a successful response, E
is the type of an error response.
pub fn sync<RPC: Rpc, Res: DeserializeOwned, E: DeserializeOwned>(
&mut self,
rpc: &RPC
) -> (OutSync<W>, InSyncResponse<R, Res, E>)
[src]
&mut self,
rpc: &RPC
) -> (OutSync<W>, InSyncResponse<R, Res, E>)
Send a sync request to the peer.
The OutSync
Future must be polled to actually start sending the request.
The InSyncResponse
Future can be polled to receive the response.
Res
is the type of a successful response, E
is the type of an error response.
pub fn source<RPC: Rpc, I: DeserializeOwned, E: DeserializeOwned>(
&mut self,
rpc: &RPC
) -> (OutSource<W>, RpcStream<R, I, E>)
[src]
&mut self,
rpc: &RPC
) -> (OutSource<W>, RpcStream<R, I, E>)
Send a source request to the peer.
The OutSource
Future must be polled to actually start sending the request.
The RpcStream
can be polled to receive the responses.
I
is the type of the responses, E
is the type of an error response.
pub fn source_cancelable<RPC: Rpc, I: DeserializeOwned, E: DeserializeOwned>(
&mut self,
rpc: &RPC
) -> (OutSourceCancelable<W>, RpcStream<R, I, E>)
[src]
&mut self,
rpc: &RPC
) -> (OutSourceCancelable<W>, RpcStream<R, I, E>)
Send a source request to the peer, that may be cancelled at any time.
The OutSource
Future must be polled to actually start sending the request, and it yields
a handle for cancelling the source. Note that if the handle is not used for cancelling, it
must still be closed.
The InSink
can be polled to receive the responses.
I
is the type of the responses, E
is the type of an error response.
pub fn sink<RPC: Rpc>(&mut self, rpc: &RPC) -> OutSink<W>
[src]
Send a sink request to the peer.
The OutSink
Future must be polled to actually start sending the request, and it yields
a sink for sending more data to the peer.
pub fn duplex<RPC: Rpc, I: DeserializeOwned, E: DeserializeOwned>(
&mut self,
rpc: &RPC
) -> (OutDuplex<W>, RpcStream<R, I, E>)
[src]
&mut self,
rpc: &RPC
) -> (OutDuplex<W>, RpcStream<R, I, E>)
Send a duplex request to the peer.
The OutSDuplex
Future must be polled to actually start sending the request, and it yields
a sink for sending more data to the peer.
The RpcStream
can be polled to receive the responses.
I
is the type of the responses, E
is the type of an error response.
pub fn close(self) -> CloseRpc<R, W>
[src]
Close the muxrpc session. If there are still active handles to the underlying transport, it is not closed immediately. It will get closed once the last of them is done.