pub struct FileIo<B> { /* private fields */ }Expand description
A pending file operation submitted through AssociatedEndpoint::read or
AssociatedEndpoint::write.
The token carries the operation’s identity and remembers the buffer type it
was submitted with, so FileIo::claim hands back the caller’s own buffer
– the same value, not a copy – once the matching completion is dequeued.
Implementations§
Source§impl<B: IoBuf> FileIo<B>
impl<B: IoBuf> FileIo<B>
Sourcepub fn id(&self) -> OperationId
pub fn id(&self) -> OperationId
The identity of the in-flight operation, for cancellation or matching.
Sourcepub fn claim(self, completion: &Completion) -> Result<(B, Result<usize>), Self>
pub fn claim(self, completion: &Completion) -> Result<(B, Result<usize>), Self>
Claim this operation’s result from completion.
On a match returns Ok((buffer, result)): buffer is the one the caller
handed over – the bytes read, or the data written – and result is the
byte count or the operation’s error. Returns Err(self) when
completion belongs to a different operation, so the caller can try the
token against another one.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for FileIo<B>
impl<B> RefUnwindSafe for FileIo<B>
impl<B> Send for FileIo<B>
impl<B> Sync for FileIo<B>
impl<B> Unpin for FileIo<B>
impl<B> UnsafeUnpin for FileIo<B>
impl<B> UnwindSafe for FileIo<B>
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