[][src]Struct actix_utils::dispatcher::Dispatcher

pub struct Dispatcher<S, T, U, I> where
    S: Service<Request = <U as Decoder>::Item, Response = I>,
    S::Error: 'static,
    S::Future: 'static,
    T: AsyncRead + AsyncWrite,
    U: Encoder<I> + Decoder,
    I: 'static,
    <U as Encoder<I>>::Error: Debug
{ /* fields omitted */ }

Dispatcher is a future that reads frames from Framed object and passes them to the service.

Implementations

impl<S, T, U, I> Dispatcher<S, T, U, I> where
    S: Service<Request = <U as Decoder>::Item, Response = I>,
    S::Error: 'static,
    S::Future: 'static,
    T: AsyncRead + AsyncWrite,
    U: Decoder + Encoder<I>,
    I: 'static,
    <U as Decoder>::Error: Debug,
    <U as Encoder<I>>::Error: Debug
[src]

pub fn new<F: IntoService<S>>(framed: Framed<T, U>, service: F) -> Self[src]

pub fn with_rx<F: IntoService<S>>(
    framed: Framed<T, U>,
    service: F,
    rx: Receiver<Result<Message<I>, S::Error>>
) -> Self
[src]

Construct new Dispatcher instance with customer mpsc::Receiver

pub fn get_sink(&self) -> Sender<Result<Message<I>, S::Error>>[src]

Get sink

pub fn get_ref(&self) -> &S[src]

Get reference to a service wrapped by Dispatcher instance.

pub fn get_mut(&mut self) -> &mut S[src]

Get mutable reference to a service wrapped by Dispatcher instance.

pub fn get_framed(&self) -> &Framed<T, U>[src]

Get reference to a framed instance wrapped by Dispatcher instance.

pub fn get_framed_mut(&mut self) -> &mut Framed<T, U>[src]

Get mutable reference to a framed instance wrapped by Dispatcher instance.

Trait Implementations

impl<S, T, U, I> Future for Dispatcher<S, T, U, I> where
    S: Service<Request = <U as Decoder>::Item, Response = I>,
    S::Error: 'static,
    S::Future: 'static,
    T: AsyncRead + AsyncWrite,
    U: Decoder + Encoder<I>,
    I: 'static,
    <U as Encoder<I>>::Error: Debug,
    <U as Decoder>::Error: Debug
[src]

type Output = Result<(), DispatcherError<S::Error, U, I>>

The type of value produced on completion.

impl<S, T, U, I> PinnedDrop for Dispatcher<S, T, U, I> where
    S: Service<Request = <U as Decoder>::Item, Response = I>,
    S::Error: 'static,
    S::Future: 'static,
    T: AsyncRead + AsyncWrite,
    U: Encoder<I> + Decoder,
    I: 'static,
    <U as Encoder<I>>::Error: Debug
[src]

impl<'pin, S, T, U, I> Unpin for Dispatcher<S, T, U, I> where
    S: Service<Request = <U as Decoder>::Item, Response = I>,
    S::Error: 'static,
    S::Future: 'static,
    T: AsyncRead + AsyncWrite,
    U: Encoder<I> + Decoder,
    I: 'static,
    <U as Encoder<I>>::Error: Debug,
    __Dispatcher<'pin, S, T, U, I>: Unpin
[src]

impl<S, T, U, I> UnsafeUnpin for Dispatcher<S, T, U, I> where
    S: Service<Request = <U as Decoder>::Item, Response = I>,
    S::Error: 'static,
    S::Future: 'static,
    T: AsyncRead + AsyncWrite,
    U: Encoder<I> + Decoder,
    I: 'static,
    <U as Encoder<I>>::Error: Debug
[src]

Auto Trait Implementations

impl<S, T, U, I> !RefUnwindSafe for Dispatcher<S, T, U, I>

impl<S, T, U, I> !Send for Dispatcher<S, T, U, I>

impl<S, T, U, I> !Sync for Dispatcher<S, T, U, I>

impl<S, T, U, I> !UnwindSafe for Dispatcher<S, T, U, I>

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.