Skip to main content

Record

Enum Record 

pub enum Record<S, B> {
Show 24 variants Start {
Show 14 fields run: RunId, id: S, wtype: S, version: u32, codec: u8, started_ms: u64, deadline_ms: u64, parent: Option<ParentRef>, policy: u8, from: Option<Origin>, copies: u32, update: Option<Box<StartUpdate<S, B>>>, input: B, meta: Option<Box<StartMeta<B>>>,
}, Step { run: RunId, seq: Seq, name: S, attempt: u32, status: Status, payload: B, time: Option<StepTime>, }, Attempt { run: RunId, seq: Seq, name: S, attempt: u32, retry_at_ms: u64, error: B, }, Timer { run: RunId, seq: Seq, name: S, fire_at_ms: u64, }, Fired { run: RunId, seq: Seq, }, Signal { run: RunId, name: S, dedup: u64, payload: B, by: Option<B>, }, Wait { run: RunId, seq: Seq, name: S, deadline_ms: u64, }, Waited { run: RunId, seq: Seq, outcome: WaitOutcome, }, Value { run: RunId, seq: Seq, kind: u8, value: B, }, Child { run: RunId, seq: Seq, wtype: S, id: S, flags: u8, deadline_ms: u64, input: B, }, ChildDone { run: RunId, seq: Seq, status: Status, payload: B, }, Send { run: RunId, seq: Seq, target: S, name: S, payload: B, }, Cancel { run: RunId, reason: B, by: Option<B>, }, Done { run: RunId, status: Status, finished_ms: u64, payload: B, by: Option<B>, }, Update { run: RunId, name: S, id: S, payload: B, caller: Option<ParentRef>, }, UpdateDone { run: RunId, seq: Seq, ordinal: u64, status: Status, payload: B, state: B, }, Heartbeat { run: RunId, seq: Seq, attempt: u32, payload: B, }, Awaiting { run: RunId, seq: Seq, name: S, attempt: u32, }, Completed { run: RunId, seq: Seq, attempt: u32, status: Status, payload: B, }, Patch { run: RunId, at: Seq, id: S, }, Attributes { run: RunId, seq: Seq, payload: B, }, Chunk { run: RunId, seq: Seq, attempt: u32, stream: S, offset: u64, payload: B, }, StreamEnd { run: RunId, seq: Seq, stream: S, chunks: u64, status: Status, }, Resume { run: RunId, seq: Seq, attempt: u32, by: Option<B>, },
}
Expand description

A journal record.

Audit: the by of a Signal, Cancel, Done (terminate, reset) or a reset’s Start names who asked, as the API that took the request saw them (a token’s scope, a proxy’s identity header, a CLI user). It is written after the record’s other fields only when present, so records without it carry no extra bytes.

Variants§

§

Start

A run was created. Its acknowledgment is released once durable.

Fields

§run: RunId
§id: S
§wtype: S
§version: u32
§codec: u8
§started_ms: u64
§deadline_ms: u64

Absolute workflow deadline in Unix milliseconds; 0 means none.

§policy: u8

See policy.

§from: Option<Origin>

The run this one continues or replaces.

§copies: u32

How many of the run’s following records are copies from from’s journal (reset). Their messages are not sent again.

§update: Option<Box<StartUpdate<S, B>>>

An update delivered in the same record (update-with-start). Boxed: rare, and it keeps every record small.

§input: B
§meta: Option<Box<StartMeta<B>>>

Who asked (a reset’s start) and the trace context: rare, so boxed.

§

Step

A step finished (or was cancelled). Delivered to code in journal order.

Fields

§run: RunId
§seq: Seq
§name: S
§attempt: u32
§status: Status
§payload: B
§time: Option<StepTime>

When it ran, under the dev profile (a STEP_TIMED record).

§

Attempt

A step attempt failed and will be retried at retry_at_ms.

Fields

§run: RunId
§seq: Seq
§name: S
§attempt: u32
§retry_at_ms: u64
§error: B
§

Timer

A durable timer was set (ctx.sleep).

Fields

§run: RunId
§seq: Seq
§name: S
§fire_at_ms: u64
§

Fired

A durable timer fired and its sleep returned. Delivered.

Fields

§run: RunId
§seq: Seq
§

Signal

A signal arrived. Its acknowledgment is released once durable. dedup (0 = none) suppresses repeated deliveries of the same message.

Fields

§run: RunId
§name: S
§dedup: u64
§payload: B
§by: Option<B>

Who sent it (audit; see Record).

§

Wait

The run began waiting for a signal; deadline_ms 0 means no timeout.

Fields

§run: RunId
§seq: Seq
§name: S
§deadline_ms: u64
§

Waited

A wait finished. Delivered.

Fields

§run: RunId
§seq: Seq
§outcome: WaitOutcome
§

Value

A recorded nondeterministic value.

Fields

§run: RunId
§seq: Seq
§kind: u8
§value: B
§

Child

The run started a child workflow. Sent once durable. flags is the child’s start policy (policy).

Fields

§run: RunId
§seq: Seq
§wtype: S
§id: S
§flags: u8
§deadline_ms: u64
§input: B
§

ChildDone

A child workflow finished. Delivered.

Fields

§run: RunId
§seq: Seq
§status: Status
§payload: B
§

Send

The run sent a signal to another workflow. Sent once durable.

Fields

§run: RunId
§seq: Seq
§target: S
§name: S
§payload: B
§

Cancel

Cancellation was delivered: every operation pending at this point in the journal ends with Status::Cancelled. Delivered.

Fields

§run: RunId
§reason: B
§by: Option<B>

Who asked (audit; see Record).

§

Done

The run finished. Its result is released once durable.

Fields

§run: RunId
§status: Status
§finished_ms: u64
§payload: B
§by: Option<B>

Who asked, when a request ended the run (terminate, reset); see Record.

§

Update

An update passed its validator and was accepted. Delivered: the handler starts at this point in the journal. Its ordinal is the number of updates the run accepted before it.

Fields

§run: RunId
§name: S
§id: S
§payload: B
§caller: Option<ParentRef>

The workflow operation waiting for the result (a call to an object from workflow code): the result is sent to it as a child result once the UpdateDone is durable.

§

UpdateDone

An update’s handler returned. Its result is released once durable.

Fields

§run: RunId
§seq: Seq
§ordinal: u64
§status: Status
§payload: B
§state: B

An object’s state changes the handler commits with its result (an encoded JSON object, sealed by the codec; empty for none).

§

Heartbeat

A running step reported progress (only the latest is kept).

Fields

§run: RunId
§seq: Seq
§attempt: u32
§payload: B
§

Awaiting

An asynchronously completed step handed out its token for attempt and now waits for engine.complete or engine.fail.

Fields

§run: RunId
§seq: Seq
§name: S
§attempt: u32
§

Completed

An asynchronously completed step got its result. Delivered.

Fields

§run: RunId
§seq: Seq
§attempt: u32
§status: Status
§payload: B
§

Patch

ctx.patched(id) took the new branch at journal position at. Takes no position itself, so adding or removing patches never shifts the journal.

Fields

§run: RunId
§at: Seq
§id: S
§

Attributes

Search attributes set by the code (a JSON object, never encrypted).

Fields

§run: RunId
§seq: Seq
§payload: B
§

Chunk

A chunk appended to one of the run’s streams (ctx.stream). seq and attempt name the step attempt that wrote it, or are stream::WORKFLOW and 0 for workflow code; offset is its place in the stream (0, 1, 2, …). Takes no journal position.

Fields

§run: RunId
§seq: Seq
§attempt: u32
§stream: S
§offset: u64
§payload: B
§

StreamEnd

A stream was completed after chunks chunks: closed by workflow code (seq stream::WORKFLOW) or by a step, or by the final result of the step that wrote it (status is that result’s).

Fields

§run: RunId
§seq: Seq
§stream: S
§chunks: u64
§status: Status
§

Resume

A paused step (an Attempt whose retry_at_ms is PAUSED) was resumed: its next attempt runs at once with a fresh retry budget. attempt is the step’s last attempt before it.

Fields

§run: RunId
§seq: Seq
§attempt: u32
§by: Option<B>

Who asked (audit; see Record).

Implementations§

§

impl<S, B> Record<S, B>

pub fn map<'a, S2, B2>( &'a self, n: impl Fn(&'a S) -> S2, p: impl Fn(&'a B) -> B2, ) -> Record<S2, B2>

The same record with its names and payloads converted.

pub fn run(&self) -> RunId

pub fn with_run(&self, new: RunId) -> Self
where S: Clone, B: Clone,

The same record for another run (reset copies a journal).

pub fn seq(&self) -> Option<Seq>

pub fn kind(&self) -> u8

§

impl<S: AsRef<str>, B: AsRef<[u8]>> Record<S, B>

pub fn for_each_name(&self, f: impl FnMut(&str))

Calls f for each interned name the record carries, in encoding order.

pub fn as_ref(&self) -> RecordRef<'_>

pub fn to_buf(&self) -> RecordBuf

Trait Implementations§

§

impl<S: Clone, B: Clone> Clone for Record<S, B>

§

fn clone(&self) -> Self

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
§

impl<S: Debug, B: Debug> Debug for Record<S, B>

§

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

Formats the value using the given formatter. Read more
§

impl<S: Eq, B: Eq> Eq for Record<S, B>

§

impl<S: PartialEq, B: PartialEq> PartialEq for Record<S, B>

§

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

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

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

Inequality operator !=. Read more
§

impl<S: PartialEq, B: PartialEq> StructuralPartialEq for Record<S, B>

Auto Trait Implementations§

§

impl<S, B> Forget for Record<S, B>

§

impl<S, B> Freeze for Record<S, B>

§

impl<S, B> Move for Record<S, B>

§

impl<S, B> RefUnwindSafe for Record<S, B>

§

impl<S, B> Send for Record<S, B>
where S: Send, Option<Box<StartUpdate<S, B>>>: Send, B: Send, Option<Box<StartMeta<B>>>: Send, Option<B>: Send,

§

impl<S, B> Sync for Record<S, B>
where S: Sync, Option<Box<StartUpdate<S, B>>>: Sync, B: Sync, Option<Box<StartMeta<B>>>: Sync, Option<B>: Sync,

§

impl<S, B> Unpin for Record<S, B>
where S: Unpin, Option<Box<StartUpdate<S, B>>>: Unpin, B: Unpin, Option<Box<StartMeta<B>>>: Unpin, Option<B>: Unpin,

§

impl<S, B> UnsafeUnpin for Record<S, B>

§

impl<S, B> UnwindSafe for Record<S, B>

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.