Binary.SlicerSourceA slice is a part of a binary representation of some data. The concatenation of multiple slices represents the whole data.
None if offset and length do not describe a valid substring.
val slice :
_ Encoding.t ->
slicer_state ->
(slice list, Data_encoding__.Binary_error_types.read_error) resultslice e state slices the data represented by the substring described by state.
If e does not correctly describe the given bytes (i.e., if read would fail on equivalent parameters) then it returns Error.
Otherwise it returns Ok sl and String.concat "" (List.map (fun s -> s.value) sl is byte-for-byte identical to the substring described by state.
slice_string slices the whole content of the string.
In other words, slice_string e s is slice e (Option.get @@ make_slicer_state s 0 (String.length s).