def Parse.byte.checked

bend-trace-context@0.2.0.0 · trace_context.bend:820

import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext
import Base
import bend-trace-context@0.2.0.0/src/digits.bend as Digits

820# The two digits of a cell, or InvalidByte at its offset when the check found
821# the cell above 255.
822def Parse.byte.checked(cell: U32, above: Bool, offset: Nat) -> Result<&2, &2, Error, Digits.Digits(2n)>:
823  match above:
824    case True{}:
825      Fail{InvalidByte{offset}}
826    case False{}:
827      Done{Digits.Digits.of_byte(cell)}

Uses (7)

Used by (1)