CursorOpenCodec.field.sized.checked: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/coordinator/CursorOpenCodec.bend as CursorOpenCodec Lines 73-91 of mylsm-lsm-store@0.6.0.1/src/coordinator/CursorOpenCodec.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/coordinator/CursorOpenCodec.bend&start_line=73&end_line=91 import Base import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes # Slices a validated span using separate copies for its start and end offsets. def field.sized.checked( payload: Bytes.Bytes, offsets: U32 & U32 & U32, lengths: U32 & U32, fits: Bool ) -> BoundResult: match offsets: case (slice_offset, (next_offset, _)): match lengths: case (slice_length, next_length): match fits: case True{}: field.sized.sliced(Bytes.slice(payload, U32.from_nat(Nat.add(U32.to_nat(slice_offset), 4n)), slice_length), U32.from_nat(Nat.add(Nat.add(U32.to_nat(next_offset), 4n), U32.to_nat(next_length)))) case False{}: BoundMalformed{} Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=slice https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/coordinator/CursorOpenCodec.bend&name=BoundResult https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/coordinator/CursorOpenCodec.bend&name=field.sized.sliced