pub struct TaskHandle { /* private fields */ }Expand description
Task handle for controlling and monitoring a task.
Implementations§
Source§impl TaskHandle
impl TaskHandle
Sourcepub fn status(&self) -> TaskStatus
pub fn status(&self) -> TaskStatus
Get the current status.
Sourcepub fn set_progress(&self, progress: u8, message: Option<&str>)
pub fn set_progress(&self, progress: u8, message: Option<&str>)
Update the task progress.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if cancellation has been requested.
Sourcepub fn cancel_token(&self) -> CancellationToken
pub fn cancel_token(&self) -> CancellationToken
Get the cancellation token.
Sourcepub fn publisher(&self) -> &EventPublisher
pub fn publisher(&self) -> &EventPublisher
Get the event publisher for this task.
Trait Implementations§
Source§impl Clone for TaskHandle
impl Clone for TaskHandle
Source§fn clone(&self) -> TaskHandle
fn clone(&self) -> TaskHandle
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TaskHandle
impl !RefUnwindSafe for TaskHandle
impl Send for TaskHandle
impl Sync for TaskHandle
impl Unpin for TaskHandle
impl !UnwindSafe for TaskHandle
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoMetered for T
impl<T> IntoMetered for T
Source§fn metered(self, metrics: Arc<ChannelMetrics>) -> MeteredSender<Self>
fn metered(self, metrics: Arc<ChannelMetrics>) -> MeteredSender<Self>
Wrap this sender with metrics tracking.
Source§impl<T> WithMetrics for T
impl<T> WithMetrics for T
Source§fn with_metrics(self) -> MeteredWrapper<Self>
fn with_metrics(self) -> MeteredWrapper<Self>
Wrap this channel with metrics tracking.