def field.value.decision

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

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

131# Selects the absent sentinel or a validated present bound.
132def field.value.decision(
133  payload: Bytes.Bytes,
134  total: U32,
135  offset: U32,
136  length: U32,
137  absent: Bool
138) -> BoundResult:
139  match absent:
140    case True{}:
141      BoundParsed{payload, None{}, U32.from_nat(
142        Nat.add(U32.to_nat(offset), 4n))}
143    case False{}:
144      field.sized(payload, total, offset, length)

Uses (9)

Used by (1)