Struct minion::Handle

source ·
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§

Get another handle for cancelling the service loop.

This can be handy if you want one thread to wait for the service loop to exit, while another watches for exit signals.

Block the current thread waiting for the service loop to exit, and return its result.

If the service loop returns an error, this method will return it in the Err value. If the service loop panics, this method will also panic with the same error.

Methods from Deref<Target = Canceller>§

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.

Trait Implementations§

The resulting type after dereferencing.
Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.