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>
Check 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>
Check readiness for write operations
Sourcepub fn init_shutdown(&self)
pub fn init_shutdown(&self)
Initiate gracefully shutdown
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Check if Io stopped
Sourcepub fn shutdown(&self, flush: bool, cx: &mut Context<'_>) -> Poll<()>
pub fn shutdown(&self, flush: bool, cx: &mut Context<'_>) -> Poll<()>
Wait when io get closed or preparing for close
Sourcepub fn get_read_buf(&self) -> BytesVec
pub fn get_read_buf(&self) -> BytesVec
Get read buffer
Sourcepub fn release_read_buf(
&self,
nbytes: usize,
buf: BytesVec,
result: Poll<Result<()>>,
) -> IoTaskStatus
pub fn release_read_buf( &self, nbytes: usize, buf: BytesVec, result: Poll<Result<()>>, ) -> IoTaskStatus
Set read buffer
Sourcepub fn get_write_buf(&self) -> Option<BytesVec>
pub fn get_write_buf(&self) -> Option<BytesVec>
Get write buffer
Sourcepub fn release_write_buf(
&self,
buf: BytesVec,
result: Poll<Result<usize>>,
) -> IoTaskStatus
pub fn release_write_buf( &self, buf: BytesVec, result: Poll<Result<usize>>, ) -> IoTaskStatus
Set write buffer
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 !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