Module Data_encoding.Binary
type read_error = Data_encoding__V1.Binary.read_error =
| Not_enough_data
| No_case_matched
| Unexpected_tag of int
| Invalid_int of {
min : int;
v : int;
max : int;
}
| Invalid_float of {
min : float;
v : float;
max : float;
}
| Trailing_zero
| Size_limit_exceeded
| List_too_long
| Array_too_long
| Exception_raised_in_user_function of string
| User_invariant_guard of string
val pp_read_error : Stdlib.Format.formatter -> read_error -> unit
val read_error_encoding : read_error Data_encoding__V1.t
type write_error = Data_encoding__V1.Binary.write_error =
| Size_limit_exceeded
| No_case_matched
| Invalid_int of {
min : int;
v : int;
max : int;
}
| Invalid_float of {
min : float;
v : float;
max : float;
}
| Invalid_bytes_length of {
expected : int;
found : int;
}
| Invalid_string_length of {
expected : int;
found : int;
}
| Invalid_natural
| List_invalid_length
| Array_invalid_length
| Exception_raised_in_user_function of string
val pp_write_error : Stdlib.Format.formatter -> write_error -> unit
val write_error_encoding : write_error Data_encoding__V1.t
val length : 'a Data_encoding__V1.Encoding.t -> 'a -> int
val fixed_length : 'a Data_encoding__V1.Encoding.t -> int option
val maximum_length : 'a Data_encoding__V1.Encoding.t -> int option
val read_opt :
'a Data_encoding__V1.Encoding.t ->
string ->
int ->
int ->
(int * 'a) option
val read_exn :
'a Data_encoding__V1.Encoding.t ->
string ->
int ->
int ->
int * 'a
type !'ret status = 'ret Data_encoding__V1.Binary.status =
| Await of Stdlib.Bytes.t -> 'ret status
| Error of read_error
val read_stream :
?init:Data_encoding__V1.Binary_stream.t ->
'a Data_encoding__V1.Encoding.t ->
'a status
type writer_state = Data_encoding__V1.Binary.writer_state
val make_writer_state :
bytes ->
offset:int ->
allowed_bytes:int ->
writer_state option
val write_opt :
'a Data_encoding__V1.Encoding.t ->
'a ->
writer_state ->
int option
val write_exn : 'a Data_encoding__V1.Encoding.t -> 'a -> writer_state -> int
val of_bytes_opt :
'a Data_encoding__V1.Encoding.t ->
Stdlib.Bytes.t ->
'a option
val of_bytes_exn : 'a Data_encoding__V1.Encoding.t -> Stdlib.Bytes.t -> 'a
val of_string :
'a Data_encoding__V1.Encoding.t ->
string ->
('a, read_error) Stdlib.result
val of_string_opt : 'a Data_encoding__V1.Encoding.t -> string -> 'a option
val of_string_exn : 'a Data_encoding__V1.Encoding.t -> string -> 'a
val to_bytes_opt :
?buffer_size:int ->
'a Data_encoding__V1.Encoding.t ->
'a ->
Stdlib.Bytes.t option
val to_string :
?buffer_size:int ->
'a Data_encoding__V1.Encoding.t ->
'a ->
(string, write_error) Stdlib.result
val to_string_opt :
?buffer_size:int ->
'a Data_encoding__V1.Encoding.t ->
'a ->
string option
val to_string_exn :
?buffer_size:int ->
'a Data_encoding__V1.Encoding.t ->
'a ->
string
val describe :
'a Data_encoding__V1.Encoding.t ->
Data_encoding__V1.Binary_schema.t
module Slicer : sig ... end
val read :
'a Data_encoding__V1.Encoding.t ->
bytes ->
int ->
int ->
(int * 'a) option
val write :
'a Data_encoding__V1.Encoding.t ->
'b ->
bytes ->
int ->
int ->
int option
val of_bytes : 'a Data_encoding__V1.Encoding.t -> Stdlib.Bytes.t -> 'b option
val to_bytes : 'a Data_encoding__V1.Encoding.t -> 'b -> Stdlib.Bytes.t option
val to_bytes_exn : 'a Data_encoding__V1.Encoding.t -> 'b -> Stdlib.Bytes.t