Struct ntex::framed::State[][src]

pub struct State(_);

Implementations

impl State[src]

pub fn new() -> Self[src]

Create State instance

pub fn from_framed<Io, U>(framed: Framed<Io, U>) -> (Io, U, Self)[src]

Create State from Framed

pub fn into_framed<Io, U>(self, io: Io, codec: U) -> Framed<Io, U>[src]

Convert state to a Framed instance

pub fn flags(&self) -> Flags[src]

Get current state flags

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

Set disconnecto timeout

pub fn set_disconnect_timeout(&self, timeout: u16)[src]

Set disconnecto timeout

pub fn take_io_error(&self) -> Option<Error>[src]

pub fn is_io_err(&self) -> bool[src]

Check if io error occured in read or write task

pub fn is_io_shutdown(&self) -> bool[src]

pub fn is_io_stop(&self) -> bool[src]

pub fn is_write_buf_full(&self) -> bool[src]

Check if write buff is full

pub fn is_read_buf_full(&self) -> bool[src]

Check if read buff is full

pub fn is_read_ready(&self) -> bool[src]

Check if read buffer has new data

pub fn is_write_ready(&self) -> bool[src]

Check if write task is ready

pub fn enable_write_backpressure(&self)[src]

Enable write back-persurre

pub fn is_keepalive(&self) -> bool[src]

Check if keep-alive timeout occured

pub fn reset_keepalive(&self)[src]

Reset keep-alive error

pub fn is_dsp_stopped(&self) -> bool[src]

Check is dispatcher marked stopped

pub fn is_open(&self) -> bool[src]

pub fn close(&self)[src]

Initiate close connection procedure

pub fn shutdown(&self)[src]

Gracefully shutdown all tasks

pub fn shutdown_io(&self)[src]

Gracefully shutdown read and write io tasks

pub fn dsp_restart_read_task(&self)[src]

Wake read io task if it is paused

pub fn dsp_restart_write_task(&self)[src]

Wake write io task

pub fn dsp_read_more_data(&self, waker: &Waker)[src]

Wake read io task if it is not ready

Only wakes if back-pressure is enabled on read task otherwise read is already awake.

pub fn dsp_enable_write_backpressure(&self, waker: &Waker)[src]

Wait until write task flushes data to socket

Write task must be waken up separately.

pub fn dsp_service_not_ready(&self, waker: &Waker)[src]

Service is not ready, register dispatch task and pause read io task

pub fn dsp_stop_io(&self, waker: &Waker)[src]

Stop io tasks

pub fn dsp_wake_task(&self)[src]

Wake dispatcher

pub fn dsp_register_task(&self, waker: &Waker)[src]

Register dispatcher task

pub fn reset_io_stop(&self)[src]

Reset io stop flags

pub fn with_read_buf<F, R>(&self, f: F) -> R where
    F: FnOnce(&mut BytesMut) -> R, 
[src]

Get mut access to read buffer

pub fn with_write_buf<F, R>(&self, f: F) -> R where
    F: FnOnce(&mut BytesMut) -> R, 
[src]

Get mut access to write buffer

impl State[src]

pub fn decode_item<U>(
    &self,
    codec: &U
) -> Result<Option<<U as Decoder>::Item>, <U as Decoder>::Error> where
    U: Decoder
[src]

Attempts to decode a frame from the read buffer.

pub async fn next<T, U>(
    &self,
    io: &mut T,
    codec: &U
) -> Result<Option<U::Item>, Either<U::Error, Error>> where
    T: AsyncRead + AsyncWrite + Unpin,
    U: Decoder
[src]

pub fn poll_next<T, U>(
    &self,
    io: &mut T,
    codec: &U,
    cx: &mut Context<'_>
) -> Poll<Result<Option<U::Item>, Either<U::Error, Error>>> where
    T: AsyncRead + AsyncWrite + Unpin,
    U: Decoder
[src]

pub async fn send<T, U>(
    &self,
    io: &mut T,
    codec: &U,
    item: U::Item
) -> Result<(), Either<U::Error, Error>> where
    T: AsyncRead + AsyncWrite + Unpin,
    U: Encoder
[src]

Encode item, send to a peer and flush

pub fn write_item<U>(
    &self,
    item: U::Item,
    codec: &U
) -> Result<bool, <U as Encoder>::Error> where
    U: Encoder
[src]

Write item to a buf and wake up io task

Returns state of write buffer state, false is returned if write buffer if full.

pub fn write_result<U, E>(
    &self,
    item: Result<Option<U::Item>, E>,
    codec: &U
) -> Result<bool, Either<E, U::Error>> where
    U: Encoder
[src]

Write item to a buf and wake up io task

Trait Implementations

impl Clone for State[src]

impl Eq for State[src]

impl Hash for State[src]

impl PartialEq<State> for State[src]

Auto Trait Implementations

impl !RefUnwindSafe for State

impl !Send for State

impl !Sync for State

impl Unpin for State

impl !UnwindSafe for State

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> CallHasher for T where
    T: Hash + ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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