pub enum Release {
AwaitingEvent,
Elapsing {
event_at: DateTime<Utc>,
opens_at: DateTime<Utc>,
},
UnrecordedEventTime,
LagOutOfRange {
event_at: DateTime<Utc>,
},
Released {
at: EventTime,
},
SkippedBranch {
at: EventTime,
},
NotSelected,
}Expand description
State of a constraint that waits for an event plus elapsed lag, at one clock reading.
Variants§
AwaitingEvent
The required event has not occurred.
Elapsing
The event occurred and positive lag is still elapsing.
Fields
UnrecordedEventTime
Positive lag must elapse from an event whose time was never recorded.
LagOutOfRange
The lag cannot be added to the event time within the supported calendar range.
Released
The constraint is satisfied.
SkippedBranch
The predecessor was excluded by a choice and the successor is an active-branch join, so the constraint is an absent branch rather than a satisfied prerequisite.
NotSelected
The predecessor was excluded by a choice; an ordinary constraint from it never releases.
Implementations§
Source§impl Release
impl Release
Sourcepub fn evaluate(
event: Option<EventTime>,
lag_hours: f64,
now: DateTime<Utc>,
) -> Self
pub fn evaluate( event: Option<EventTime>, lag_hours: f64, now: DateTime<Utc>, ) -> Self
Evaluate one constraint against an adapter-supplied clock reading.
Positive lag delays release by elapsed time. Negative lag (lead) only shapes the schedule projection: execution still waits for the event itself, so it is treated as zero here.
Sourcepub fn evaluate_with(
event: Option<EventTime>,
lag_hours: f64,
now: DateTime<Utc>,
lag_end: impl FnOnce(DateTime<Utc>, f64) -> Option<DateTime<Utc>>,
) -> Self
pub fn evaluate_with( event: Option<EventTime>, lag_hours: f64, now: DateTime<Utc>, lag_end: impl FnOnce(DateTime<Utc>, f64) -> Option<DateTime<Utc>>, ) -> Self
Evaluate one constraint whose positive lag ends at lag_end(event_at, hours), such as
working hours of a calendar; None from it means the lag is out of range.
Sourcepub fn released_at(self) -> Option<EventTime>
pub fn released_at(self) -> Option<EventTime>
Release time when satisfied.