pub struct TaskHandle { /* private fields */ }Expand description
A task being worked on in the background: keep it (it’s Clone and
Send), report progress, and finish it. Updates after the task finished
(or was canceled) are ignored.
Implementations§
Source§impl TaskHandle
impl TaskHandle
pub fn id(&self) -> &str
Sourcepub fn working(&self, note: Option<&str>)
pub fn working(&self, note: Option<&str>)
Working, with an optional progress note to the client.
Sourcepub fn complete_with(&self, message: Message)
pub fn complete_with(&self, message: Message)
Done with a closing message.
Sourcepub fn input_required(&self, question: &str)
pub fn input_required(&self, question: &str)
Waiting for the client to answer question (its next message
carries this task’s id).
Sourcepub fn is_canceled(&self) -> bool
pub fn is_canceled(&self) -> bool
The client canceled the task: stop working on it.
Trait Implementations§
Source§impl Clone for TaskHandle
impl Clone for TaskHandle
Auto Trait Implementations§
impl Freeze for TaskHandle
impl RefUnwindSafe for TaskHandle
impl Send for TaskHandle
impl Sync for TaskHandle
impl Unpin for TaskHandle
impl UnsafeUnpin for TaskHandle
impl UnwindSafe for TaskHandle
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