Environment: add Data_encoding.check_size

This commit is contained in:
Marco Stronati 2018-06-13 16:49:02 +02:00 committed by Benjamin Canou
parent 8f5aecfc01
commit 0d136b0bd7

View File

@ -263,3 +263,9 @@ module Binary : sig
exception Write_error of write_error
end
(** [check_size size encoding] ensures that the binary encoding
of a value will not be allowed to exceed [size] bytes. The reader
and the writer fails otherwise. This function do not modify
the JSON encoding. *)
val check_size : int -> 'a encoding -> 'a encoding