[][src]Struct ntex::util::framed::Dispatcher

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

FramedTransport - is a future that reads frames from Framed object and pass then to the service.

Methods

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

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

Construct new Dispatcher instance

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

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

Construct new Dispatcher instance with outgoing messages stream.

pub fn disconnect_timeout(self, val: u64) -> Self[src]

Set connection disconnect timeout in milliseconds.

Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the connection get dropped.

To disable timeout set value to 0.

By default disconnect timeout is set to 1 seconds.

Trait Implementations

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

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

The type of value produced on completion.

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

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

Auto Trait Implementations

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

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

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

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

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> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,