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 strThe 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: StringWhat 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
impl NormalizedEvent
Sourcepub fn new(
id: i64,
name: &'static str,
category: Category,
group: GroupRef,
role: Role,
) -> Self
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.
pub fn with_time(self, time: Option<i64>) -> Self
pub fn with_subject(self, subject: impl Into<String>) -> Self
pub fn with_outcome(self, outcome: Outcome) -> Self
Trait Implementations§
Source§impl Clone for NormalizedEvent
impl Clone for NormalizedEvent
Source§fn clone(&self) -> NormalizedEvent
fn clone(&self) -> NormalizedEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more