Module Encoding.Variable

Create encodings that produce data of a variable length when binary encoded. See the preamble for an explanation.

val string : string encoding
val bytes : Stdlib.Bytes.t encoding
val array : ?⁠max_length:int -> 'a encoding -> 'a array encoding
raises Invalid_argument

if the encoding argument is variable length or may lead to zero-width representation in binary.

val list : ?⁠max_length:int -> 'a encoding -> 'a list encoding
raises Invalid_argument

if the encoding argument is variable length or may lead to zero-width representation in binary.