JoinHandle
struct · ferroui-system · v0.5.0
struct JoinHandle<T>
The handle of a spawned task (spawn_local,
spawn_local_on): a future of its outcome, the output of its future
or a JoinError.
Dropping the handle detaches the task, which keeps running. The handle is Send when the
output is: it may be awaited or aborted from another thread, while the task runs on its own.
It has one owner; shared makes a handle for several observers.
Members
is_finished
fn is_finished(self: &Self) -> bool
Whether the task has ended, in any way.
id
fn id(self: &Self) -> Id
The id of the task.
abort_handle
fn abort_handle(self: &Self) -> AbortHandle
A handle that aborts the task, for other owners than the one of the outcome.
abort
fn abort(self: &Self)
Aborts the task: its future is dropped and the outcome is JoinError::Canceled, unless
it has ended. On the task's thread the future is dropped at once (when the task is being
polled, right after that poll); from another thread, when the task's thread polls it next
(its schedule, or run_pending for the queue of the thread).
shared
fn shared(self: Self) -> Shared<T>
where T: Clone + 'static
The outcome of the task for several observers, on the current thread: see Shared.
Panics
When the handle has given the outcome already (it was polled to the end).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyIntoFutureFutureDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.