Struct ntex::framed::State [−][src]
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]
F: FnOnce(&mut BytesMut) -> R,
Get mut access to read buffer
pub fn with_write_buf<F, R>(&self, f: F) -> R where
F: FnOnce(&mut BytesMut) -> R,
[src]
F: FnOnce(&mut BytesMut) -> R,
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]
&self,
codec: &U
) -> Result<Option<<U as Decoder>::Item>, <U as Decoder>::Error> where
U: Decoder,
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]
&self,
io: &mut T,
codec: &U
) -> Result<Option<U::Item>, Either<U::Error, Error>> where
T: AsyncRead + AsyncWrite + Unpin,
U: Decoder,
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]
&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,
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]
&self,
io: &mut T,
codec: &U,
item: U::Item
) -> Result<(), Either<U::Error, Error>> where
T: AsyncRead + AsyncWrite + Unpin,
U: Encoder,
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]
&self,
item: U::Item,
codec: &U
) -> Result<bool, <U as Encoder>::Error> where
U: Encoder,
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]
&self,
item: Result<Option<U::Item>, E>,
codec: &U
) -> Result<bool, Either<E, U::Error>> where
U: Encoder,
Write item to a buf and wake up io task
Trait Implementations
impl Clone for State
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for State
[src]
impl Hash for State
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash + ?Sized,
[src]
T: Hash + ?Sized,
pub default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64 where
H: Hash + ?Sized,
B: BuildHasher,
[src]
H: Hash + ?Sized,
B: BuildHasher,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,