TaskHandle
struct · ferroui-xaml-interactions · v0.5.0
struct TaskHandle<T: 'static>
A task of the dispatcher of the user interface, held as an untyped value (Task<T>): its
JoinHandle, shared.
Clones refer to the same task and compare equal. Awaiting a handle gives the outcome of the
task: its output, or a JoinError (Panicked when the future panicked, a value, not raised
again; Canceled when the task was aborted or the dispatcher shut down). Any number of clones
may await it; the output is taken by the first, the others get the failure or the
cancellation again, and () again for a task without a value.
Members
spawnfrom_handlefrom_taskis_completedis_completed_successfullyis_faultedis_canceledabortcompleted
spawn
fn spawn<Fut>(future: Fut) -> Self
where Fut: Future<Output = T> + 'static
Runs future on the dispatcher of the user interface and returns its task
(Dispatcher.UIThread.InvokeAsync(async () => ..)). The future starts in a job of the
dispatcher at DispatcherPriority::DEFAULT.
Panics
Panics when called from a thread other than the thread of the user interface.
from_handle
fn from_handle(handle: JoinHandle<T>) -> Self
The task of the handle of a task of the dispatcher.
from_task
fn from_task(task: DispatcherTask<T>) -> Self
The task of an existing dispatcher task.
Deprecated: the task of the handle of a task of the dispatcher is
from_handle (From); the DispatcherTask converts into a
JoinHandle (on the dispatcher thread).
Deprecated since 0.5.0. use
TaskHandle::from_handlewith aJoinHandle(DispatcherTaskconverts into one)
is_completed
fn is_completed(self: &Self) -> bool
Whether the task has finished: completed, failed or canceled (IsCompleted).
is_completed_successfully
fn is_completed_successfully(self: &Self) -> bool
Whether the task ran to the end (IsCompletedSuccessfully).
is_faulted
fn is_faulted(self: &Self) -> bool
Whether the future of the task panicked (IsFaulted).
is_canceled
fn is_canceled(self: &Self) -> bool
Whether the task was canceled (IsCanceled).
abort
fn abort(self: &Self)
Aborts the task, unless it has ended: its future is dropped, and it ends canceled.
completed
fn completed() -> Self
A task that has already completed (Task.CompletedTask).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyIntoFutureToOwnedPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherFrom<JoinHandle<T>>ClonePartialEqDebugFuture
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.