def packed_decode.valid
bend-kit-protobuf@0.2.0.0 · protobuf.bend:515
import bend-kit-protobuf@0.2.0.0/protobuf.bend as Protobuf
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as B
515def packed_decode.valid(valid: Bool, kind: U32, b: B.Bytes, max_size: U32) -> Result<&2, &1, Error, List<&1, Value>>:
516 match valid:
517 case False{}:
518 Fail{Malformed{}}
519 case True{}:
520 B.Bytes{+n, buf} = b
521 packed_decode.limit(U32.is_le(n, U32.min(max_size, 2147483647)), kind, B.Bytes{n, buf}, n)