types/moment

Types

A finite moment of time represented as simple start and end integers.

Constructors

  • Moment { start: Int, end: Int }

A finite list of moments of time.

Alias

Moments = List<Moment>

Functions

shift(m: Moment, t: Int) -> Moment

Shifts a moment by some integer amount. This is great for incrementing a fixed moment of time, maybe like an epoch boundary by five days.

moment.shift(this_moment, a_day)

is_logical(m: Moment) -> Bool

Check if a moment data structure is logical.

moment.is_logical(datum.moment)

is_contained(m: Moment, vr: ValidityRange) -> Bool

Check if a validity range is contained within some moment. This assumes inclusivity.

|start–|lower––upper|–end|

moment.is_contained(datum.moment, this_tx.validity_range)

is_after(m: Moment, vr: ValidityRange) -> Bool

Check if a validity range of a tx is after a moment. This assumes exclusivity.

|start––end|–|lower––upper|

moment.is_after(datum.moment, this_tx.validity_range)

is_before(m: Moment, vr: ValidityRange) -> Bool

Check if a validity range of a tx is before a moment. This assumes exclusivity.

|lower––upper|–|start––end|

moment.is_before(datum.moment, this_tx.validity_range)
Search Document