package bare_encoding

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

Module Bare_encodingSource

BARE runtime library.

See the spec.

Sourcemodule String_map : sig ... end
Sourcemodule Decode : sig ... end

Decoders.

Sourcemodule Encode : sig ... end

Encoder type and some encoding utils.

Sourcemodule Pp : sig ... end

Pretty printer utils, using Format.

Sourceval 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)

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

Same as of_bytes_exn but doesn't raise.

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

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

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

Safe version of of_string_exn

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

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