def read_blob.length
import bend-kit-protobuf@0.2.0.0/protobuf.bend as Protobufimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as B
148def read_blob.length(ok: Bool, c: B.Cursor, +n: U32) -> Result<&2, &1, Error, B.Cursor & B.Bytes>:
149 match ok:
150 case False{}:
151 Fail{Malformed{}}
152 case True{}:
153 B.Cursor{b, +pos, start, +end} = c
154 read_blob.fits(B.fits(end, pos, n), B.Cursor{b, pos, start, end}, n)