Struct miow::iocp::CompletionStatus

source ·
#[repr(transparent)]
pub struct CompletionStatus(_);
Expand description

A status message received from an I/O completion port.

These statuses can be created via the new or empty constructors and then provided to a completion port, or they are read out of a completion port. The fields of each status are read through its accessor methods.

Implementations§

source§

impl CompletionStatus

source

pub fn new( bytes: u32, token: usize, overlapped: *mut Overlapped ) -> CompletionStatus

Creates a new completion status with the provided parameters.

This function is useful when creating a status to send to a port with the post method. The parameters are opaquely passed through and not interpreted by the system at all.

source

pub fn from_entry(entry: &OVERLAPPED_ENTRY) -> &CompletionStatus

Creates a new borrowed completion status from the borrowed OVERLAPPED_ENTRY argument provided.

This method will wrap the OVERLAPPED_ENTRY in a CompletionStatus, returning the wrapped structure.

source

pub fn zero() -> CompletionStatus

Creates a new “zero” completion status.

This function is useful when creating a stack buffer or vector of completion statuses to be passed to the get_many function.

source

pub fn bytes_transferred(&self) -> u32

Returns the number of bytes that were transferred for the I/O operation associated with this completion status.

source

pub fn token(&self) -> usize

Returns the completion key value associated with the file handle whose I/O operation has completed.

A completion key is a per-handle key that is specified when it is added to an I/O completion port via add_handle or add_socket.

source

pub fn overlapped(&self) -> *mut OVERLAPPED

Returns a pointer to the Overlapped structure that was specified when the I/O operation was started.

source

pub fn entry(&self) -> &OVERLAPPED_ENTRY

Returns a pointer to the internal OVERLAPPED_ENTRY object.

Trait Implementations§

source§

impl Clone for CompletionStatus

source§

fn clone(&self) -> CompletionStatus

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CompletionStatus

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for CompletionStatus

source§

impl Send for CompletionStatus

source§

impl Sync for CompletionStatus

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.