Skip to main content

TaskEvent

Struct TaskEvent 

Source
pub struct TaskEvent<'a> {
    pub workflow_id: &'a str,
    pub task_id: &'a str,
    pub function: &'a str,
    pub status: Option<u16>,
    pub duration: Duration,
}
Expand description

One finished task.

Borrowed for the duration of the callback; an observer must copy out anything it needs to keep.

Fields§

§workflow_id: &'a str

Workflow::id of the workflow the task belongs to.

§task_id: &'a str

Task::id.

§function: &'a str

The function name — one of the built-in names, or a Custom handler’s registered name.

Note this reports "validate" for both validation and validate configs: they share a single FunctionConfig::Validation variant, and this is that variant’s canonical name.

§status: Option<u16>

TaskOutcome::audit_status() for a successful dispatch, Some(500) when the task returned Err.

None means the handler returned TaskOutcome::Skip — the body ran, but no audit entry was recorded for it.

§duration: Duration

Wall-clock duration of the task body only: the dispatch call, not the condition evaluation, the audit-trail push, or the metadata.progress write.

Derived from two Utc::now() reads rather than a monotonic clock, because std::time::Instant::now() panics on wasm32-unknown-unknown and the wasm bindings route through these instrumentation points. A backward clock step clamps to zero rather than wrapping.

Trait Implementations§

Source§

impl<'a> Debug for TaskEvent<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for TaskEvent<'a>

§

impl<'a> RefUnwindSafe for TaskEvent<'a>

§

impl<'a> Send for TaskEvent<'a>

§

impl<'a> Sync for TaskEvent<'a>

§

impl<'a> Unpin for TaskEvent<'a>

§

impl<'a> UnsafeUnpin for TaskEvent<'a>

§

impl<'a> UnwindSafe for TaskEvent<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.