Struct miow::Overlapped

source ·
pub struct Overlapped(_);
Expand description

A wrapper around OVERLAPPED to provide “rustic” accessors and initializers.

Implementations§

source§

impl Overlapped

source

pub fn zero() -> Overlapped

Creates a new zeroed out instance of an overlapped I/O tracking state.

This is suitable for passing to methods which will then later get notified via an I/O Completion Port.

source

pub fn initialize_with_autoreset_event() -> Result<Overlapped>

Creates a new Overlapped with an initialized non-null hEvent. The caller is responsible for calling CloseHandle on the hEvent field of the returned Overlapped. The event is created with bManualReset set to FALSE, meaning after a single thread waits on the event, it will be reset.

source

pub unsafe fn from_raw<'a>(ptr: *mut OVERLAPPED) -> &'a mut Overlapped

Creates a new Overlapped function pointer from the underlying OVERLAPPED, wrapping in the “rusty” wrapper for working with accessors.

Unsafety

This function doesn’t validate ptr nor the lifetime of the returned pointer at all, it’s recommended to use this method with extreme caution.

source

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

Gain access to the raw underlying data

source

pub fn set_offset(&mut self, offset: u64)

Sets the offset inside this overlapped structure.

Note that for I/O operations in general this only has meaning for I/O handles that are on a seeking device that supports the concept of an offset.

source

pub fn offset(&self) -> u64

Reads the offset inside this overlapped structure.

source

pub fn set_event(&mut self, event: HANDLE)

Sets the hEvent field of this structure.

The event specified can be null.

source

pub fn event(&self) -> HANDLE

Reads the hEvent field of this structure, may return null.

Trait Implementations§

source§

impl Debug for Overlapped

source§

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

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

impl Send for Overlapped

source§

impl Sync for Overlapped

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, 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.