pub struct IoContext(/* private fields */);Expand description
Context for io read task
Implementations§
Source§impl IoContext
impl IoContext
Sourcepub fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness>
pub fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness>
Checks readiness for read operations.
Sourcepub fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness>
pub fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<Readiness>
Checks readiness for write operations.
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Checks if the I/O stream is stopped.
Sourcepub fn get_read_buf(&self) -> BytesMut
pub fn get_read_buf(&self) -> BytesMut
Gets the read buffer.
Sourcepub fn resize_read_buf(&self, buf: &mut BytesMut)
pub fn resize_read_buf(&self, buf: &mut BytesMut)
Resizes the read buffer.
Sourcepub fn update_read_status(
&self,
buf: BytesMut,
status: Result<usize>,
) -> IoTaskStatus
pub fn update_read_status( &self, buf: BytesMut, status: Result<usize>, ) -> IoTaskStatus
Updates the read status.
Returns Ok(Some(buf)) containing the read buffer.
Ok(None) indicates that the connection has been disconnected.
Sourcepub fn with_write_buf<F, R>(&self, f: F) -> R
pub fn with_write_buf<F, R>(&self, f: F) -> R
Gets the write buffer.
Sourcepub fn update_write_status(&self, status: Result<bool>) -> IoTaskStatus
pub fn update_write_status(&self, status: Result<bool>) -> IoTaskStatus
Updates the write status.
Ok(true) indicates that one or more bytes were successfully written
to the I/O stream.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IoContext
impl !RefUnwindSafe for IoContext
impl !Send for IoContext
impl !Sync for IoContext
impl Unpin for IoContext
impl UnsafeUnpin for IoContext
impl !UnwindSafe for IoContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more