def Entry.of

bend-kit-cache@0.3.0.0 · cache.bend:47

import bend-kit-cache@0.3.0.0/cache.bend as Cache
import Base

47# The entry for a result fetched at `at`. Its age counts from the fetch start.
48def Entry.of(-V: Data, r: Found<V>, p: Policy, at: Nat) -> Entry<V>:
49  match r:
50    case Found{v, x}:
51      Policy{ttl, neg} = p
52      Hit{v, x, Nat.add(at, ttl)}
53    case Missing{}:
54      Policy{ttl, neg} = p
55      Miss{Nat.add(at, neg)}

Uses (5)

Used by (1)