pub struct Handle<E> { /* private fields */ }
Expand description
A handle to a running service loop.
You can use it to cancel the running loop at the next opportunity (through [Handle::cancel
]),
or to wait for the loop to terminate (through Handle::wait
). You can also use
Handle::canceller
to get a Canceller
handle, which lets you terminate the service loop
elsewhere (e.g., while waiting).
Implementations§
Methods from Deref<Target = Canceller>§
sourcepub fn cancel(&self)
pub fn cancel(&self)
Cancel the currently running service loop. This method does not block; it sends a signal that the service loop should cease execution and returns immediately.
Note that this will not interrupt a currently executing Cancellable::for_each
.
Instead, the next time Cancellable::for_each
would be called, the service loop will
return.