pub struct Completion { /* private fields */ }Expand description
A completion packet dequeued from a CompletionPort.
Dequeuing removes the operation from the port’s outstanding set, so holding a
completion never blocks CompletionPort::run_down or the port’s Drop. The
completion still owns the operation’s storage until it is dropped or
claimed, and may outlive the port it came from.
Implementations§
Source§impl Completion
impl Completion
Sourcepub fn bytes_transferred(&self) -> u32
pub fn bytes_transferred(&self) -> u32
The number of bytes transferred by the operation.
Sourcepub fn overlapped_ptr(&self) -> *mut OVERLAPPED
pub fn overlapped_ptr(&self) -> *mut OVERLAPPED
The OVERLAPPED pointer identifying the completed operation.
For a user packet this is whatever value was passed to
CompletionPort::post.
Sourcepub fn id(&self) -> Option<OperationId>
pub fn id(&self) -> Option<OperationId>
The identity of the operation this packet completes.
It matches the OperationId that AssociatedEndpoint::submit
returned for the operation, so a caller holding submission-time
identities can match a completion against them directly. Returns None
for a user packet from CompletionPort::post, which completes no
operation.
Sourcepub fn error(&self) -> Option<&Error>
pub fn error(&self) -> Option<&Error>
The failure of the completed operation, if it did not succeed.
Sourcepub unsafe fn claim<P>(&self) -> Operation<P>
pub unsafe fn claim<P>(&self) -> Operation<P>
Recover the owned operation whose completion this is.
§Safety
This completion must have been produced by submitting an Operation<P>
of this exact type through AssociatedEndpoint::submit, and it must be
claimed exactly once.