package bare_encoding

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

BARE runtime library.

See the spec.

module String_map : sig ... end
module Decode : sig ... end

Decoders.

module Encode : sig ... end

Encoder type and some encoding utils.

module Pp : sig ... end

Pretty printer utils, using Format.

val of_bytes_exn : ?off:int -> 'a Decode.dec -> bytes -> 'a

of_bytes_exn dec bs uses dec to decode a value of type 'a from bytes stored in bs.

  • parameter off

    the initial offset in bs (default 0)

val of_bytes : ?off:int -> 'a Decode.dec -> bytes -> ('a, string) result

Same as of_bytes_exn but doesn't raise.

val of_string_exn : 'a Decode.dec -> string -> 'a

Decode a value stored in the string. See of_bytes_exn for more details.

val of_string : 'a Decode.dec -> string -> ('a, string) result

Safe version of of_string_exn

val to_string : 'a Encode.enc -> 'a -> string

Encode a value of type 'a into a string using the given encoder.

OCaml

Innovation. Community. Security.