pub struct EnumerationHandle { /* private fields */ }Expand description
A live enumeration’s affine handle.
Holding one is what keeps an enumeration running: dropping it asks the session to stop that enumeration. The handle is not clonable and not copyable, so exactly one owner decides when the enumeration ends.
Cancellation is asynchronous. It enters the submission ring like every other control operation and takes effect when the servicer reaches it, so entries already queued still arrive and exactly one terminal outcome still follows them.
Implementations§
Source§impl EnumerationHandle
impl EnumerationHandle
Sourcepub fn id(&self) -> EnumerationId
pub fn id(&self) -> EnumerationId
Which enumeration this handle controls.
Completion records carry the same identifier, which is how a caller attributes them when several enumerations share one session.
Sourcepub fn cancel(self)
pub fn cancel(self)
Ask the session to stop this enumeration.
Returns immediately. Cancellation cannot preempt a directory query that
is already executing, so entries produced before it is observed are still
delivered, followed by one
Cancelled terminal.
Sourcepub fn detach(self)
pub fn detach(self)
Give up control of this enumeration and let it run to completion.
The cancellation reservation returns to the submission ring, so a detached enumeration costs the session nothing beyond its terminal slot. It still reports its outcome; a caller simply loses the ability to stop it early.