[][src]Trait tarpc::rpc::server::Channel

pub trait Channel where
    Self: Transport<Response<Self::Resp>, Request<Self::Req>>, 
{ type Req; type Resp; pub fn config(&self) -> &Config;
pub fn in_flight_requests(self: Pin<&mut Self>) -> usize;
pub fn start_request(
        self: Pin<&mut Self>,
        request_id: u64
    ) -> AbortRegistration; pub fn max_concurrent_requests(self, n: usize) -> Throttler<Self>
    where
        Self: Sized
, { ... }
pub fn respond_with<S>(self, server: S) -> ClientHandler<Self, S>
    where
        S: Serve<Self::Req, Resp = Self::Resp>,
        Self: Sized
, { ... } }

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

type Req[src]

Type of request item.

type Resp[src]

Type of response sink item.

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.

Loading content...

Provided methods

pub fn max_concurrent_requests(self, n: usize) -> Throttler<Self> where
    Self: Sized
[src]

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]

Respond to requests coming over the channel with f. Returns a future that drives the responses and resolves when the connection is closed.

Loading content...

Implementors

impl<C> Channel for Throttler<C> where
    C: Channel
[src]

type Req = <C as Channel>::Req

type Resp = <C as Channel>::Resp

impl<Req, Resp, T> Channel for BaseChannel<Req, Resp, T> where
    T: Transport<Response<Resp>, ClientMessage<Req>>, 
[src]

type Req = Req

type Resp = Resp

Loading content...