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: boolSuppress 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: boolDo 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
impl Clone for NotificationModes
Source§fn clone(&self) -> NotificationModes
fn clone(&self) -> NotificationModes
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more