def fresh.at

cswap-bend-cli@0.1.0.0 · policy/usage.bend:170

import cswap-bend-cli@0.1.0.0/policy/usage.bend as Usage
import Base
import cswap-bend-cli@0.1.0.0/policy/types.bend as T

170# A reading is decision-grade when it is at most 300 s old, or its trust is
171# extended (the row is failing, planned, held or claimed) and within the
172# ceiling of `within.ceiling`.
173def fresh.at(+fa: Maybe<&2, Nat>, +now: Nat, +e: T.ErrKind, +nf: Nat, +np: Maybe<&2, Nat>, +hu: Nat, +cu: Nat, +soonest: Maybe<&2, Nat>) -> Bool:
174  match fa:
175    case None{}:
176      False{}
177    case Some{f}:
178      fresh.age(Nat.sub(now, f), fresh.ext(now, nf, np, hu, cu), within.ceiling(e, Nat.sub(now, f), now, soonest))

Uses (8)

Used by (2)