pub struct WorkloopRecord {
pub loop_id: WorkflowId,
pub namespace: String,
pub spec: WorkloopSpec,
pub window_seq: u64,
pub next_window_at: Option<DateTime<Utc>>,
pub next_check_at: Option<DateTime<Utc>>,
pub last_iteration_closed_window: Option<u64>,
pub invariant_health: BTreeMap<String, InvariantHealthState>,
pub registered_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
One durable workloop registration: the declared spec plus the engine’s cadence and health bookkeeping.
Fields§
§loop_id: WorkflowIdThe loop’s workflow identity (primary key).
namespace: StringNamespace the loop runs in.
spec: WorkloopSpecThe declared spec — re-validated on decode by WorkloopSpec’s own
serde boundary, so a stored record cannot drift out of its declared
invariants.
window_seq: u64Sequence number of the last cadence window that fired (0 = none yet; fired windows are one-based).
next_window_at: Option<DateTime<Utc>>When the next cadence window fires; None on a signal-only loop.
next_check_at: Option<DateTime<Utc>>When the sweeper must next evaluate this loop: the minimum of
next_window_at and the earliest duration-form tolerance deadline.
None = nothing left to check engine-side (a signal-only loop whose
alarms are all latched); sleeping loops with a future value cost the
sweeper nothing.
last_iteration_closed_window: Option<u64>The window sequence of the last recorded iteration close, if any — what the dead-man switch compares against the fired window (R4.3).
invariant_health: BTreeMap<String, InvariantHealthState>Per-invariant health accounting, keyed by invariant name.
registered_at: DateTime<Utc>When the loop was registered.
updated_at: DateTime<Utc>Most recent mutation instant.
Implementations§
Source§impl WorkloopRecord
impl WorkloopRecord
Sourcepub fn encode(&self) -> Result<Vec<u8>, StoreError>
pub fn encode(&self) -> Result<Vec<u8>, StoreError>
Encode the stable backend-neutral representation.
§Errors
Returns StoreError::Serialization when serialization fails.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, StoreError>
pub fn decode(bytes: &[u8]) -> Result<Self, StoreError>
Decode and re-validate a stored representation (the spec’s serde boundary re-runs every declaration check).
§Errors
Returns StoreError::Serialization for malformed bytes or a spec
that no longer satisfies its declaration invariants.
Trait Implementations§
Source§impl Clone for WorkloopRecord
impl Clone for WorkloopRecord
Source§fn clone(&self) -> WorkloopRecord
fn clone(&self) -> WorkloopRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more