[][src]Struct tokio_tower::multiplex::server::Server

pub struct Server<T, S> where
    T: Sink<S::Response> + TryStream,
    S: Service<<T as TryStream>::Ok>, 
{ /* fields omitted */ }

This type provides an implementation of a Tower Service on top of a multiplexed protocol transport. In particular, it wraps a transport that implements Sink<SinkItem = Response> and Stream<Item = Request> with the necessary bookkeeping to adhere to Tower's convenient fn(Request) -> Future<Response> API.

Methods

impl<T, S> Server<T, S> where
    T: Sink<S::Response> + TryStream,
    S: Service<<T as TryStream>::Ok>, 
[src]

pub fn new(transport: T, service: S) -> Self[src]

Construct a new Server over the given transport that services requests using the given service.

Requests are passed to Service::call as they arrive, and responses are written back to the underlying transport in the order that they complete. If a later request completes before an earlier request, its response is still sent immediately.

Trait Implementations

impl<T: Debug, S: Debug> Debug for Server<T, S> where
    T: Sink<S::Response> + TryStream,
    S: Service<<T as TryStream>::Ok>,
    S::Future: Debug
[src]

impl<T, S> Future for Server<T, S> where
    T: Sink<S::Response> + TryStream,
    S: Service<<T as TryStream>::Ok>, 
[src]

type Output = Result<(), Error<T, S>>

The type of value produced on completion.

impl<T, S> PinnedDrop for Server<T, S> where
    T: Sink<S::Response> + TryStream,
    S: Service<<T as TryStream>::Ok>, 
[src]

impl<'pin, T, S> Unpin for Server<T, S> where
    T: Sink<S::Response> + TryStream,
    S: Service<<T as TryStream>::Ok>,
    __Server<'pin, T, S>: Unpin
[src]

Auto Trait Implementations

impl<T, S> !RefUnwindSafe for Server<T, S>

impl<T, S> Send for Server<T, S> where
    S: Send,
    T: Send,
    <S as Service<<T as TryStream>::Ok>>::Future: Send

impl<T, S> Sync for Server<T, S> where
    S: Sync,
    T: Sync,
    <S as Service<<T as TryStream>::Ok>>::Future: Sync

impl<T, S> !UnwindSafe for Server<T, S>

Blanket Implementations

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

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

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

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

impl<T> FutureExt for T where
    T: Future + ?Sized
[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<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized
[src]

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.