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

pub struct Dispatcher<S, T, U, I> where
    S: Service<<U as Decoder>::Item, Response = I>,
    S::Error: 'static,
    S::Future: 'static,
    T: AsyncRead,
    T: AsyncWrite,
    U: Encoder<I>,
    U: 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<<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>(framed: Framed<T, U>, service: F) -> Self where
    F: IntoService<S, <U as Decoder>::Item>, 
[src]

pub fn with_rx<F>(
    framed: Framed<T, U>,
    service: F,
    rx: Receiver<Result<Message<I>, S::Error>>
) -> Self where
    F: IntoService<S, <U as Decoder>::Item>, 
[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<<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<'__pin, S, T, U, I> Unpin for Dispatcher<S, T, U, I> where
    __Origin<'__pin, S, T, U, I>: Unpin,
    S: Service<<U as Decoder>::Item, Response = I>,
    S::Error: 'static,
    S::Future: 'static,
    T: AsyncRead,
    T: AsyncWrite,
    U: Encoder<I>,
    U: 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>[src]

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

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

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

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

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<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.