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
) -> (Async<W>, AsyncResponse<R, Res, E>)
[src]
&mut self,
rpc: &RPC
) -> (Async<W>, AsyncResponse<R, Res, E>)
Send an async request to the peer.
The Async
Future must be polled to actually start sending the request.
The AsyncResponse
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
) -> (Sync<W>, SyncResponse<R, Res, E>)
[src]
&mut self,
rpc: &RPC
) -> (Sync<W>, SyncResponse<R, Res, E>)
Send a sync request to the peer.
The Sync
Future must be polled to actually start sending the request.
The SyncResponse
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
) -> (Source<W>, RpcStream<R, I, E>)
[src]
&mut self,
rpc: &RPC
) -> (Source<W>, RpcStream<R, I, E>)
Send a source request to the peer.
The Source
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
) -> (SourceCancelable<W>, RpcStream<R, I, E>)
[src]
&mut self,
rpc: &RPC
) -> (SourceCancelable<W>, RpcStream<R, I, E>)
Send a source request to the peer, that may be cancelled at any time.
The Source
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) -> MuxSink<W>
[src]
Send a sink request to the peer.
The MuxSink
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
) -> (Duplex<W>, RpcStream<R, I, E>)
[src]
&mut self,
rpc: &RPC
) -> (Duplex<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.