Skip to main content

NormalizedEvent

Struct NormalizedEvent 

Source
pub struct NormalizedEvent {
    pub id: i64,
    pub time: Option<i64>,
    pub name: &'static str,
    pub category: Category,
    pub group: GroupRef,
    pub role: Role,
    pub outcome: Outcome,
    pub subject: String,
    pub attempt: Option<i32>,
    pub failure: Option<String>,
    pub fields: Vec<(&'static str, String)>,
    pub payloads: Vec<(String, Payload)>,
}
Expand description

One protobuf history event, flattened.

Deliberately not a 60-variant mirror of the protobuf oneof. Everything downstream needs, what it is about, which group it joins, whether it opens or closes that group, how it ended, is extracted by the mapping in tmprl-client, so this module and the views never touch a generated type or re-derive the same facts.

Fields§

§id: i64§time: Option<i64>

Epoch milliseconds.

§name: &'static str

The protobuf event name, e.g. ActivityTaskScheduled. Kept verbatim because it is what Temporal’s own docs, the CLI and the web UI all call it.

§category: Category§group: GroupRef§role: Role§outcome: Outcome§subject: String

What the event is about: an activity type, a timer id, a signal name.

§attempt: Option<i32>

Attempt number, where the protocol reports one. A retry does not produce a second scheduling event, the count lives here.

§failure: Option<String>

Failure message, when the event carries one.

§fields: Vec<(&'static str, String)>

Detail rows for the expanded view, in protocol order.

§payloads: Vec<(String, Payload)>

Payloads this event carries, labelled, input, result, details[1]. Labels are owned because an argument list needs an index in them.

Implementations§

Source§

impl NormalizedEvent

Source

pub fn new( id: i64, name: &'static str, category: Category, group: GroupRef, role: Role, ) -> Self

A minimal event, for tests and for the arms of the mapping that carry nothing else.

Source

pub fn with_time(self, time: Option<i64>) -> Self

Source

pub fn with_subject(self, subject: impl Into<String>) -> Self

Source

pub fn with_outcome(self, outcome: Outcome) -> Self

Trait Implementations§

Source§

impl Clone for NormalizedEvent

Source§

fn clone(&self) -> NormalizedEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NormalizedEvent

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for NormalizedEvent

Source§

impl PartialEq for NormalizedEvent

Source§

fn eq(&self, other: &NormalizedEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NormalizedEvent

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.