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

pub struct Dispatcher<S, U> where
    S: Service<Request = DispatchItem<U>, Response = Option<<U as Encoder>::Item>>,
    S::Error: 'static,
    S::Future: 'static,
    U: Encoder,
    U: Decoder,
    <U as Encoder>::Item: 'static, 
{ /* fields omitted */ }

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

Implementations

impl<S, U> Dispatcher<S, U> where
    S: Service<Request = DispatchItem<U>, Response = Option<<U as Encoder>::Item>> + 'static,
    U: Decoder + Encoder + 'static,
    <U as Encoder>::Item: 'static, 
[src]

pub fn new<T, F: IntoService<S>>(
    io: T,
    codec: U,
    state: State,
    service: F,
    timer: Timer
) -> Self where
    T: AsyncRead + AsyncWrite + Unpin + 'static, 
[src]

Construct new Dispatcher instance.

pub fn from_state<F: IntoService<S>>(
    codec: U,
    state: State,
    service: F,
    timer: Timer
) -> Self
[src]

Construct new Dispatcher instance.

pub fn keepalive_timeout(self, timeout: u16) -> Self[src]

Set keep-alive timeout in seconds.

To disable timeout set value to 0.

By default keep-alive timeout is set to 30 seconds.

pub fn disconnect_timeout(self, val: u16) -> 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, U> Future for Dispatcher<S, U> where
    S: Service<Request = DispatchItem<U>, Response = Option<<U as Encoder>::Item>> + 'static,
    U: Decoder + Encoder + 'static,
    <U as Encoder>::Item: 'static, 
[src]

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

The type of value produced on completion.

impl<'__pin, S, U> Unpin for Dispatcher<S, U> where
    __Origin<'__pin, S, U>: Unpin,
    S: Service<Request = DispatchItem<U>, Response = Option<<U as Encoder>::Item>>,
    S::Error: 'static,
    S::Future: 'static,
    U: Encoder,
    U: Decoder,
    <U as Encoder>::Item: 'static, 
[src]

Auto Trait Implementations

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

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

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

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

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

impl<T> Instrument for T[src]

impl<T> Instrument 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> 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

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

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