pub struct ReadHandle { /* private fields */ }Expand description
Handle to a read. Await it for the result.
Dropping it before completion abandons the result only; if the op was
already submitted it also sends IORING_OP_ASYNC_CANCEL (best effort) so the
CQE — and with it the buffer reclamation — arrives sooner.
without_cancel_on_drop disables that to model the bare “quorum drops the
future” case.
Submission is eager whenever a backpressure permit is immediately available
(the common case, unchanged from the blocking implementation). Only when the
semaphore is saturated does the handle acquire the permit and submit on its
first poll, so submit never blocks a runtime worker.
Implementations§
Source§impl ReadHandle
impl ReadHandle
Sourcepub fn without_cancel_on_drop(self) -> Self
pub fn without_cancel_on_drop(self) -> Self
Keep the driver’s buffer until the normal CQE even when this handle is dropped.
By default, dropping an in-flight handle sends a best-effort
IORING_OP_ASYNC_CANCEL request to accelerate reclamation. This method
disables that request while preserving the same memory-safety guarantee:
the driver still owns the buffer and file descriptor until the read’s
completion arrives. It is useful when cancellation traffic would add
more work than the abandoned read itself.