[][src]Struct tarpc_lib::server::Channel

pub struct Channel<Req, Resp, T> { /* fields omitted */ }

Responds to all requests with request_handler. The server end of an open connection with a client.

Methods

impl<Req, Resp, T> Channel<Req, Resp, T> where
    T: Transport<Item = ClientMessage<Req>, SinkItem = Response<Resp>> + Send,
    Req: Send,
    Resp: Send
[src]

pub fn client_addr(&self) -> &SocketAddr[src]

Returns the address of the client connected to the channel.

pub fn respond_with<F, Fut>(self, f: F) -> impl Future<Output = ()> where
    F: FnOnce(Context, Req) -> Fut + Send + 'static + Clone,
    Fut: Future<Output = Result<Resp>> + Send + 'static,
    Req: 'static,
    Resp: 'static, 
[src]

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

Trait Implementations

impl<Req, Resp, T> Drop for Channel<Req, Resp, T>[src]

impl<Req: Debug, Resp: Debug, T: Debug> Debug for Channel<Req, Resp, T>[src]

Auto Trait Implementations

impl<Req, Resp, T> Send for Channel<Req, Resp, T> where
    Req: Send,
    Resp: Send,
    T: Send

impl<Req, Resp, T> Sync for Channel<Req, Resp, T> where
    Req: Sync,
    Resp: Sync,
    T: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]