TaskCompletionSource
struct · ferroui-system · v0.5.0
struct TaskCompletionSource<T>
The producer side of a task that code ends by hand (TaskCompletionSource<TResult>).
Deprecated since 0.5.0. use
ferroui_system::task::oneshot::channel(a sender of aResult; dropping it cancels), orShared::channelfor synchronous continuations
Members
new
fn new() -> Self
A source with a task that has not ended.
task
fn task(self: &Self) -> Task<T>
The task of the source (Task).
set_result
fn set_result(self: &Self, result: T)
Ends the task with result (SetResult).
Panics
When the task has ended (InvalidOperationException).
try_set_result
fn try_set_result(self: &Self, result: T) -> bool
Ends the task with result unless it has ended (TrySetResult).
set_exception
fn set_exception(self: &Self, error: ObservableError)
Ends the task with error (SetException); a cancellation (Canceled,
TaskCanceledError) cancels it.
Panics
When the task has ended (InvalidOperationException).
try_set_exception
fn try_set_exception(self: &Self, error: ObservableError) -> bool
Ends the task with error unless it has ended (TrySetException).
set_canceled
fn set_canceled(self: &Self)
Cancels the task (SetCanceled).
Panics
When the task has ended (InvalidOperationException).
try_set_canceled
fn try_set_canceled(self: &Self) -> bool
Cancels the task unless it has ended (TrySetCanceled).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedFrom<TaskCompletionSource<T>>DefaultClone
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.