def mode

mylsm-lsm-store@0.6.0.1 · src/coordinator/CursorOpenCodec.bend:326

import mylsm-lsm-store@0.6.0.1/src/coordinator/CursorOpenCodec.bend as CursorOpenCodec
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

326# Selects range or prefix decoding from the exact mode word.
327def mode(
328  payload: Bytes.Bytes,
329  snapshot_id: U32,
330  total: U32,
331  parsed: Maybe<&2, U32>
332) -> Decision:
333  match parsed:
334    case Some{0}: range.decode(payload, snapshot_id, total)
335    case Some{1}: prefix.decode(payload, snapshot_id, total)
336    case _: Malformed{}

Uses (9)

Used by (1)