Module record
Expand description
Journal records.
A record is one fact about one workflow run. The same Record type is used
borrowed (RecordRef, for encoding on the hot path) and owned
(RecordBuf, after decoding). Records have two encodings:
- Segment: inside a log segment. Workflow type and step names are interned per segment: the first record that uses a name defines it in a prefix, later records refer to it by a small integer.
- Canonical: names written inline. Used for journals held in memory, spilled run blobs, checkpoints, replication and the server protocol, so a record means the same thing wherever it travels.
Modules§
- kind
- origin
- policy
- The policy byte of a
Startrecord (and theflagsof aChildrecord, which become the child’s start policy). Recorded so replay and recovery apply the same rules. - stream
- Streams (
ctx.stream). - value_
kind - Recorded nondeterministic values (
ctx.now(),ctx.random(), …).
Structs§
- Inline
- Canonical encoding: names inline.
- Inline
Decoder - Canonical decoding. Repeated names share one allocation.
- Origin
- Where a run came from, when it is not a fresh start.
- Parent
Ref - The parent of a child workflow: the shard and run that started it and the journal position that waits for its result.
- Start
Meta - The rare fields of a
Startrecord, boxed so every record stays small. - Start
Update - An update carried by a
Startrecord (update-with-start). - Step
Time - When a step ran: recorded under the dev profile only (production steps read no clock for it and write no byte), for the UI’s timeline.
Enums§
- Record
- A journal record.
- Status
- How a step, child or workflow ended.
- Wait
Outcome - The outcome of a
Waitedrecord.
Constants§
- PAUSED
- The
retry_at_msof anAttemptwhose step is paused: retried only once aRecord::Resumefollows.
Traits§
- Name
Decoder - How names are read from a record body.
- Name
Encoder - How names are written into a record body.
- ToName
- A record’s string field as a
Name: shared when it is one already, allocated when borrowed. - ToPayload
- A record’s payload as a
Payload: shared when it is one, copied when borrowed.
Functions§
- decode_
body - Decodes a record body produced by
encode_body. Fails on trailing bytes. - decode_
canonical_ all - Decodes a concatenation of
encode_canonicalrecords. - decode_
canonical_ into decode_canonical_allintoout(cleared first), with a name cache the caller keeps: names repeated across journals (workflow types, step names) are then decoded without allocating.- encode_
body - Encodes the record body: the kind byte, then fields.
definesholds new interned names to define in a prefix (segment encoding only). - encode_
canonical - Canonical encoding of one record, appended to
outwith a varint length prefix so records can be concatenated into journals and blobs. - start_
record - A plain start record (no origin, copies or update).