pub struct DeferredToken { /* private fields */ }Expand description
Token to return in IoResult::Defer for deferred
IOs.
Create with defer_read or defer_write.
Implementations§
Source§impl DeferredToken
impl DeferredToken
Sourcepub fn poll_read(
&mut self,
cx: &mut Context<'_>,
bytes: &mut [u8],
) -> Poll<Result<(), IoError>>
pub fn poll_read( &mut self, cx: &mut Context<'_>, bytes: &mut [u8], ) -> Poll<Result<(), IoError>>
Polls the deferred token for the results of a read operation.
Copies the results into bytes.
Panics if the deferred token was for a write operation.
Sourcepub fn poll_write(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), IoError>>
pub fn poll_write(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), IoError>>
Polls the deferred token for the results of a write operation.
Panics if the deferred token was for a read operation.
Sourcepub async fn write_future(self) -> Result<(), IoError>
pub async fn write_future(self) -> Result<(), IoError>
Returns a future that waits for the deferred write to complete.
Panics if the deferred token was for a read operation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeferredToken
impl !RefUnwindSafe for DeferredToken
impl Send for DeferredToken
impl Sync for DeferredToken
impl Unpin for DeferredToken
impl UnsafeUnpin for DeferredToken
impl !UnwindSafe for DeferredToken
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