Skip to main content

Event

Enum Event 

Source
#[non_exhaustive]
pub enum Event<'a> {
#[non_exhaustive]
RunStarted { program: ProgramId, message_id: &'a str, channel: Option<&'a str>, considered: usize, },
#[non_exhaustive]
WorkflowStarted { workflow: WorkflowIx, id: &'a str, },
#[non_exhaustive]
TaskFinished { info: &'a CallInfo<'a>, status: Option<u16>, elapsed: Option<Duration>, },
#[non_exhaustive]
WorkflowFinished { record: &'a WorkflowRecord<'a>, elapsed: Option<Duration>, },
#[non_exhaustive]
RunFinished { message_id: &'a str, status: &'a RunStatus, errors: usize, elapsed: Option<Duration>, }, }
Expand description

One event of a run, borrowed for the call to Observer::on: an observer copies out what it keeps.

An elapsed is Some only for an observer whose interest holds Interest::TIMINGS. Each variant is #[non_exhaustive]: match its fields with .., so a fact added later breaks no host.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

#[non_exhaustive]
RunStarted

The run starts, after its stamps, before any workflow.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§program: ProgramId

The program the run runs.

§message_id: &'a str

The message’s id.

§channel: Option<&'a str>

The channel the run was started on.

§considered: usize

How many workflows the run considers: its channel’s Active ones, before any rollout or condition is judged.

§

#[non_exhaustive]
WorkflowStarted

A workflow was selected: its condition admitted it, or it has none. Once per workflow, a loop’s included. A workflow that ends Ran with no judgment of its condition reached (a loop that enters no sweep, or a run stopped before the condition) gets it as it ends, before its WorkflowFinished.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§workflow: WorkflowIx

The workflow’s position in the program.

§id: &'a str

The workflow’s id.

§

#[non_exhaustive]
TaskFinished

A call was recorded: once per call, a fan-out’s once per element it folds, and once with no element for a fan-out with nothing to call or cut short. A task its condition refused is not.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§info: &'a CallInfo<'a>

The call: its workflow, its task and the function’s registered name, its loop counter and its element.

§status: Option<u16>

The status recorded; None for a Skip.

§elapsed: Option<Duration>

How long the call ran, the recording not included.

§

#[non_exhaustive]
WorkflowFinished

A workflow that was selected ended. Its record says how, and how many sweeps it ran.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§record: &'a WorkflowRecord<'a>

What the workflow did.

§elapsed: Option<Duration>

How long since its WorkflowStarted.

§

#[non_exhaustive]
RunFinished

The run ended, whatever its status.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§message_id: &'a str

The message’s id, as its RunStarted named it: what ties the end to the start when one observer sees runs overlap.

§status: &'a RunStatus

How the run ended.

§errors: usize

How many error records the message holds.

§elapsed: Option<Duration>

How long the run took.

Trait Implementations§

Source§

impl<'a> Debug for Event<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Event<'a>

§

impl<'a> !UnwindSafe for Event<'a>

§

impl<'a> Freeze for Event<'a>

§

impl<'a> Send for Event<'a>

§

impl<'a> Sync for Event<'a>

§

impl<'a> Unpin for Event<'a>

§

impl<'a> UnsafeUnpin for Event<'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 = !

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

fn try_from(value: U) -> Result<T, !>

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.