def get.if

bend-kit-bytes@0.3.3.0 · bytes.bend:134

import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import Base

134def get.if(ok: Bool, +len: U32, buf: Array<U32>, +i: U32) -> Bytes & Maybe<&2, U32>:
135  match ok:
136    case True{}:
137      get.some(len, peek(buf, i))
138    case False{}:
139      (Bytes{len, buf}, None{})

Uses (9)

Used by (1)