Skip to main content

Timeline

Struct Timeline 

Source
pub struct Timeline { /* private fields */ }
Expand description

Execution events and derived completion times of every work item at one clock reading.

This is the single evaluator of relation gates: task readiness and lifecycle commands, milestone and package completion, progress and the remaining schedule all read edge releases from here, so they cannot disagree. It is derived from authoritative facts and never persisted.

Implementations§

Source§

impl Timeline

Source

pub fn start_edge(&self, plan: &Plan, edge: &Dependency) -> StartRelease

Evaluate an edge for the successor’s claim or start.

A provisional edge releases on the predecessor’s current attempt’s submission plus positive lag until its verified finish releases it, so verifying that attempt never pushes an elapsing start gate later. Every other evaluation, including the successor’s verification and milestone reach, uses Timeline::edge, so a submission never counts as a finish there. A legacy submission without an attempt record has nothing a basis could reference, so its edge waits for verification.

Source

pub fn next_release(&self, plan: &Plan) -> Option<DateTime<Utc>>

The earliest instant after this timeline’s clock reading at which a pending gate opens with no change to the plan: an elapsing dependency lag (including a provisional start lag) or a decision gate released with elapsing lag.

Time passing is the only change, so an adapter that evaluated at Timeline::now knows when to evaluate again. The instant is the exact opening boundary: a reading strictly before it still sees the gate elapsing, a reading at it sees it released. A fact recorded with a future time is not reported as elapsing, so it is not included.

Source§

impl Timeline

Source

pub fn at(plan: &Plan, now: DateTime<Utc>) -> Self

Derive completion from a validated plan and an adapter-supplied clock reading.

Tasks complete when verified and their conditions are selected. A milestone is reached when it is applicable and every unwaived incoming edge and every decision gating it or its containers is released; its time is the latest of those releases and of the choices that selected it or skipped its branches. A work package completes when every child that a choice did not exclude is complete, and at least one is, at the latest child, choice or gate time; a package whose children were all excluded or cannot proceed is not applicable, so it is never complete.

Source

pub fn incoming<'a>( &'a self, plan: &'a Plan, work: WorkItemId, ) -> impl Iterator<Item = &'a Dependency>

Enforced incoming edges in source order, for the same immutable plan used by this timeline.

Source

pub fn now(&self) -> DateTime<Utc>

Clock reading this timeline was evaluated at.

Source

pub fn completed_at(&self, work: WorkItemId) -> Option<EventTime>

Completion time of verified tasks, reached milestones and completed packages.

Source

pub fn completed(&self) -> BTreeSet<WorkItemId>

Identities of all completed work.

Source

pub fn event( &self, plan: &Plan, work: WorkItemId, endpoint: Endpoint, ) -> Option<EventTime>

Time of a work item’s start or finish event, if it has occurred.

Source

pub fn applicability(&self, work: WorkItemId) -> &Applicability

Whether work belongs to the active graph, and if not, why.

Source

pub fn edge(&self, plan: &Plan, edge: &Dependency) -> Release

Whether an edge’s required predecessor event plus positive lag has elapsed.

A constraint from not-selected work is a skipped branch, released once the choice has been made, only into an active-branch join; into any other successor it never releases.

Source

pub fn decisions<'a>( &self, plan: &'a Plan, work: WorkItemId, ) -> Vec<(&'a Decision, Release)>

Decisions naming this work or a containing package as blocked, with their release state.

Source

pub fn selecting_choices<'a>( &self, plan: &'a Plan, work: WorkItemId, ) -> Vec<(&'a Decision, EventTime)>

Decisions whose standing outcomes select applicable work through its own or its containers’ conditions, each with the time that outcome has held; empty for work that is not applicable.

Work cannot have taken a transition before the choice that put it in the plan was made.

Trait Implementations§

Source§

impl Clone for Timeline

Source§

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
Source§

impl Debug for Timeline

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Timeline

Source§

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
Source§

impl StructuralPartialEq for Timeline

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.