def apply

mylsm-lsm-store@0.6.0.1 · src/scan/VisibleStats.bend:35

import mylsm-lsm-store@0.6.0.1/src/scan/VisibleStats.bend as VisibleStats
import Base

35# Applies the visible effect of one key's before and after states.
36def apply(
37  current: Stats,
38  key_bytes: Nat,
39  before: Maybe<&1, Nat>,
40  after: Maybe<&1, Nat>
41) -> Decision:
42  match before:
43    case None{}:
44      match after:
45        case None{}: unchanged(current)
46        case Some{new_bytes}: added(current, key_bytes, new_bytes)
47    case Some{old_bytes}:
48      match after:
49        case None{}: removed(current, key_bytes, old_bytes)
50        case Some{new_bytes}: replaced(current, old_bytes, new_bytes)

Uses (8)

Used by (2)