[−][src]Trait tarpc::rpc::server::Channel
The server end of an open connection with a client, streaming in requests from, and sinking responses to, the client.
Channels are free to somewhat rely on the assumption that all in-flight requests are eventually
either cancelled or responded to. Safety cannot
rely on this assumption, but it is best for Channel
users to always account for all outstanding
requests.
Associated Types
Loading content...Required methods
pub fn config(&self) -> &Config
[src]
Configuration of the channel.
pub fn in_flight_requests(self: Pin<&mut Self>) -> usize
[src]
Returns the number of in-flight requests over this channel.
pub fn start_request(self: Pin<&mut Self>, request_id: u64) -> AbortRegistration
[src]
Tells the Channel that request with ID request_id
is being handled.
The request will be tracked until a response with the same ID is sent
to the Channel.
Provided methods
pub fn max_concurrent_requests(self, n: usize) -> Throttler<Self> where
Self: Sized,
[src]
Self: Sized,
Caps the number of concurrent requests.
pub fn respond_with<S>(self, server: S) -> ClientHandler<Self, S> where
S: Serve<Self::Req, Resp = Self::Resp>,
Self: Sized,
[src]
S: Serve<Self::Req, Resp = Self::Resp>,
Self: Sized,
Respond to requests coming over the channel with f
. Returns a future that drives the
responses and resolves when the connection is closed.
Implementors
impl<C> Channel for Throttler<C> where
C: Channel,
[src]
C: Channel,
type Req = <C as Channel>::Req
type Resp = <C as Channel>::Resp
pub fn in_flight_requests(self: Pin<&mut Self>) -> usize
[src]
pub fn config(&self) -> &Config
[src]
pub fn start_request(self: Pin<&mut Self>, request_id: u64) -> AbortRegistration
[src]
impl<Req, Resp, T> Channel for BaseChannel<Req, Resp, T> where
T: Transport<Response<Resp>, ClientMessage<Req>>,
[src]
T: Transport<Response<Resp>, ClientMessage<Req>>,