Std.Leb128
include Core_kernel.Bin_prot.Binable.S with type t := t
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (int -> t) Bin_prot.Read.reader
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_t : t Bin_prot.Type_class.t
type 'a encoder = ?signed:bool -> 'a -> t
encode ~signed v
encodes value v
in a LEB128 format. If signed is true, then uses signed encoding.
decode leb
decodes a number from LEB128 representation.
type 'a decoder = t -> 'a Core_kernel.Or_error.t
decode leb
decodes a number from LEB128 representation.
val size : t -> int
size leb
return size in bytes of the number stored in LEB128 encoding.
val read :
?signed:bool ->
string ->
pos_ref:int Core_kernel.ref ->
t Core_kernel.Or_error.t
val write : t -> Regular.Std.bytes -> pos:int -> unit
val to_int : int decoder
val to_int32 : int32 decoder
val to_int64 : int64 decoder
val of_int : int encoder
val of_int32 : int32 encoder
val of_int64 : int64 encoder