def Cursor.read.if

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

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

876def Cursor.read.if(~T: Data, ~read: Bytes -> @+i:U32 -> Bytes & Maybe<&2, T>, ok: Bool, c: Cursor, +n: U32) -> Cursor & Maybe<&2, T>:
877  match ok:
878    case False{}:
879      (c, None{})
880    case True{}:
881      Cursor{b, +pos, start, end} = c
882      Cursor.read.done(~T, pos, start, end, n, read(b, pos))

Uses (8)

Used by (1)