Struct ntex::framed::State [−][src]
pub struct State(_);
Implementations
impl State
[src]
impl State
[src]pub fn from_framed<Io, U>(framed: Framed<Io, U>) -> (Io, U, Self)
[src]
pub fn from_framed<Io, U>(framed: Framed<Io, U>) -> (Io, U, Self)
[src]Create State
from Framed
pub fn with_params(
max_read_buf_size: u16,
max_write_buf_size: u16,
min_buf_size: u16,
disconnect_timeout: u16
) -> Self
[src]
pub fn with_params(
max_read_buf_size: u16,
max_write_buf_size: u16,
min_buf_size: u16,
disconnect_timeout: u16
) -> Self
[src]Create State
instance with custom params
pub fn into_framed<Io, U>(self, io: Io, codec: U) -> Framed<Io, U>
[src]
pub fn into_framed<Io, U>(self, io: Io, codec: U) -> Framed<Io, U>
[src]Convert State to a Framed instance
pub fn set_buffer_params(
&self,
max_read_buf_size: u16,
max_write_buf_size: u16,
min_buf_size: u16
)
[src]
pub fn set_buffer_params(
&self,
max_read_buf_size: u16,
max_write_buf_size: u16,
min_buf_size: u16
)
[src]Set read/write buffer sizes
By default read max buf size is 8kb, write max buf size is 8kb
pub fn set_disconnect_timeout(&self, timeout: u16)
[src]
pub fn set_disconnect_timeout(&self, timeout: u16)
[src]Set io disconnect timeout in secs
pub fn on_disconnect(&self) -> OnDisconnectⓘNotable traits for OnDisconnect
impl Future for OnDisconnect type Output = ();
[src]
pub fn on_disconnect(&self) -> OnDisconnectⓘNotable traits for OnDisconnect
impl Future for OnDisconnect type Output = ();
[src]Notify when socket get disconnected
pub fn is_keepalive(&self) -> bool
[src]
pub fn is_keepalive(&self) -> bool
[src]Check if keep-alive timeout occured
pub fn is_dispatcher_stopped(&self) -> bool
[src]
pub fn is_dispatcher_stopped(&self) -> bool
[src]Check is dispatcher marked stopped
pub fn is_open(&self) -> bool
[src]
pub fn stop_io(&self, waker: &Waker)
[src]
pub fn stop_io(&self, waker: &Waker)
[src]Stop io tasks
Wake dispatcher when read or write task is stopped.
pub fn shutdown_io(&self)
[src]
pub fn shutdown_io(&self)
[src]Gracefully shutdown read and write io tasks
pub fn take_io_error(&self) -> Option<Error>
[src]
pub fn take_io_error(&self) -> Option<Error>
[src]Take io error if any occured
pub fn reset_io_stop(&self)
[src]
pub fn reset_io_stop(&self)
[src]Reset io stop flags
pub fn reset_keepalive(&self)
[src]
pub fn reset_keepalive(&self)
[src]Reset keep-alive error
pub fn wake_dispatcher(&self)
[src]
pub fn wake_dispatcher(&self)
[src]Wake dispatcher task
pub fn register_dispatcher(&self, waker: &Waker)
[src]
pub fn register_dispatcher(&self, waker: &Waker)
[src]Register dispatcher task
pub fn dispatcher_stopped(&self)
[src]
pub fn dispatcher_stopped(&self)
[src]Mark dispatcher as stopped
pub fn close(&self)
[src]
pub fn close(&self)
[src]Gracefully close connection
First stop dispatcher, then dispatcher stops io tasks
pub fn force_close(&self)
[src]
pub fn force_close(&self)
[src]Force close connection
Dispatcher does not wait for uncompleted responses, but flushes io buffers.
impl State
[src]
impl State
[src]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 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]Read incoming io stream and decode codec item.
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]
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 then flush
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,
Trait Implementations
impl Eq 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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> CallHasher for T where
T: Hash + ?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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more