pub struct TaskContext {
pub task_id: Uuid,
pub name: String,
pub category: TaskCategory,
pub plugin_id: Option<String>,
pub correlation_id: Option<CorrelationId>,
pub progress: Arc<dyn ProgressReporter>,
pub cancellation_token: CancellationToken,
pub metadata: Metadata,
}
Fields§
§task_id: Uuid
§name: String
§category: TaskCategory
§plugin_id: Option<String>
§correlation_id: Option<CorrelationId>
§progress: Arc<dyn ProgressReporter>
§cancellation_token: CancellationToken
§metadata: Metadata
Implementations§
Source§impl TaskContext
impl TaskContext
pub fn is_cancelled(&self) -> bool
pub async fn cancelled(&self)
pub fn report_progress(&self, progress: TaskProgress)
pub fn report_percent(&self, percent: u8, message: impl Into<String>)
pub fn report_step(&self, current: u32, total: u32, message: impl Into<String>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TaskContext
impl !RefUnwindSafe for TaskContext
impl Send for TaskContext
impl Sync for TaskContext
impl Unpin for TaskContext
impl !UnwindSafe for TaskContext
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
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.