Struct ntex_io::Io

source ·
pub struct Io<F = Base>(_, _);
Expand description

Interface object to underlying io stream

Implementations§

Create Io instance

Create Io instance in specific memory pool.

Set memory pool

Set io disconnect timeout in millis

Clone current io object.

Current io object becomes closed.

Get instance of IoRef

Get referece to a filter

Convert current io stream into sealed version

Create new filter and replace current one

Map current filter with new one

Read incoming io stream and decode codec item.

Wait until read becomes ready.

Pause read task

Encode item, send to a peer

Wake write task and instruct to flush data.

This is async version of .poll_flush() method.

Gracefully shutdown io stream

Polls for read readiness.

If the io stream is not currently ready for reading, this method will store a clone of the Waker from the provided Context. When the io stream becomes ready for reading, Waker::wake will be called on the waker.

Return value The function returns:

Poll::Pending if the io stream is not ready for reading. Poll::Ready(Ok(Some(())))) if the io stream is ready for reading. Poll::Ready(Ok(None)) if io stream is disconnected Some(Poll::Ready(Err(e))) if an error is encountered.

Decode codec item from incoming bytes stream.

Wake read task and request to read more data if data is not enough for decoding. If error get returned this method does not register waker for later wake up action.

Wake write task and instruct to flush data.

If full is true then wake up dispatcher when all data is flushed otherwise wake up when size of write buffer is lower than buffer max size.

Gracefully shutdown io stream

Wait for status updates

Methods from Deref<Target = IoRef>§

Get memory pool

Check if io stream is closed

Wake dispatcher task

Gracefully close connection

Notify dispatcher and initiate io stream shutdown process.

Force close connection

Dispatcher does not wait for uncompleted responses. Io stream get terminated without any graceful period.

Gracefully shutdown io stream

Query filter specific data

Encode and write item to a buffer and wake up write task

Attempts to decode a frame from the read buffer

Write bytes to a buffer and wake up write task

Get mut access to write buffer

Get mut access to read buffer

Start keep-alive timer

Stop keep-alive timer

Notify when io stream get disconnected

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Executes the destructor for this type. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.