def Entry.of
import bend-kit-cache@0.3.0.0/cache.bend as Cacheimport 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)}