pub struct TaskValueSource { /* private fields */ }Expand description
The producer side of a TaskValue that is not bound to a future: the
equivalent of a task completion source.
Implementations§
Source§impl TaskValueSource
impl TaskValueSource
pub fn new() -> Self
Sourcepub fn set_result<T: PropertyValue>(&self, value: T)
pub fn set_result<T: PropertyValue>(&self, value: T)
Completes the task with value. Panics if the task has already
finished.
Sourcepub fn set_untyped_result(&self, value: Option<BoxedValue>)
pub fn set_untyped_result(&self, value: Option<BoxedValue>)
Completes the task with an untyped value. Panics if the task has already finished.
Sourcepub fn set_exception(&self, error: BindingError)
pub fn set_exception(&self, error: BindingError)
Fails the task with error. Panics if the task has already finished.
Sourcepub fn try_set_untyped_result(&self, value: Option<BoxedValue>) -> bool
pub fn try_set_untyped_result(&self, value: Option<BoxedValue>) -> bool
Completes the task with an untyped value unless it has already finished.
Sourcepub fn try_set_exception(&self, error: BindingError) -> bool
pub fn try_set_exception(&self, error: BindingError) -> bool
Fails the task with error unless it has already finished.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TaskValueSource
impl !Send for TaskValueSource
impl !Sync for TaskValueSource
impl !UnwindSafe for TaskValueSource
impl Freeze for TaskValueSource
impl Unpin for TaskValueSource
impl UnsafeUnpin for TaskValueSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more