Skip to main content

NotificationModes

Struct NotificationModes 

Source
pub struct NotificationModes {
    pub skip_completion_port_on_success: bool,
    pub skip_set_event_on_handle: bool,
}
Expand description

Which completion-notification shortcuts a handle should take.

These are the two SetFileCompletionNotificationModes flags. Both trade a notification the I/O Manager would otherwise deliver for the cost of not having it, so both are opt-in per endpoint rather than anything this crate chooses on a caller’s behalf.

Every field defaults to false, which is the handle’s ordinary behaviour.

Fields§

§skip_completion_port_on_success: bool

Suppress the completion packet for an operation that succeeds immediately, rather than queueing one the caller must still dequeue.

This is the throughput knob. Ordinarily an IOCP-associated overlapped handle gets a packet for every completed request, including one that returned success without ever returning ERROR_IO_PENDING – see crate::Issued::Pending. Setting this removes the queue, the dequeue, and the worker wakeup for each such operation, which is a real win where operations frequently complete synchronously (cached reads, small socket sends, loopback) and changes nothing for ones that genuinely go asynchronous.

The cost is that a submission now has two possible shapes, so every adapter on this endpoint reports crate::Started::Completed on the synchronous path instead of a claim-later token. A caller that does not handle that arm will lose results.

§skip_set_event_on_handle: bool

Do not set the file object’s own event for a request that returns success, or that returns ERROR_IO_PENDING from an asynchronous call.

Independent of the completion port: it concerns the handle’s internal event, which completion-port-driven code does not wait on. An event supplied explicitly in the OVERLAPPED is still signalled.

Do not set this on an endpoint destined for crate::BlockingEndpoint, which waits on exactly that internal event: suppressing it leaves the wait with nothing to wake it.

Trait Implementations§

Source§

impl Clone for NotificationModes

Source§

fn clone(&self) -> NotificationModes

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for NotificationModes

Source§

impl Debug for NotificationModes

Source§

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

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

impl Default for NotificationModes

Source§

fn default() -> NotificationModes

Returns the “default value” for a type. Read more
Source§

impl Eq for NotificationModes

Source§

impl Hash for NotificationModes

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for NotificationModes

Source§

fn eq(&self, other: &NotificationModes) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NotificationModes

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

type Error = !

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 T
where U: TryFrom<T>,

Source§

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.