package biniou
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8bf3ff17cd0ecb2d6b6d1d94cb08ef089d44caef96e9bae6be6839d428fa318f
sha512=7d03b3759a3a2e1c77713aa1b8375a1f1917f49d14fe5e3cb01d5e53a12e6385b7a3b0f4827f3be71182c31c416d780e1f9ef011dc205cb8f9b0ab2d8fc23cfd
doc/biniou/Bi_io/index.html
Module Bi_ioSource
Input and output functions for the Biniou serialization format
Node tags
Tag indicating a table node.
Tag indicating a shared node.
Write one-byte tag to a buffer.
Read one-byte tag from a buffer.
Tags of variants and record fields
31-bit hash
Hash function used to compute field name tags and variant tags from their full name.
write_hashtag ob h has_arg writes variant tag h to buffer ob. has_arg indicates whether the variant has an argument. This function can be used for record field names as well, in which case has_arg may only be true.
read_hashtag ib f reads a variant tag as hash h and flag has_arg and returns f h has_arg.
read_field_hashtag ib reads a field tag and returns the 31-bit hash.
Compute the hash of each string of the input list and return a function that converts a hash back to the original string. Lookups do not allocate memory blocks.
7-bit int used to represent a num_variant tag.
write_numtag ob i has_arg writes the tag of a num_variant. The tag name is represented by i which must be within [0, 127] and the flag has_arg which indicates the presence of an argument.
read_numtag ib f reads a num_variant tag and processes the tag name i and flag has_arg using f.
Atom writers
The write_untagged_ functions write an untagged value (VAL) to an output buffer while the other write_ functions write a tagged value (TAGVAL).
Atom readers
The read_untagged_ functions read an untagged value (VAL) from an input buffer.
Read and discard a value. Useful for skipping unknown record fields.
Generic tree
type tree = [ | `Unit| `Bool of bool| `Int8 of char| `Int16 of int| `Int32 of Int32.t| `Int64 of Int64.t| `Float32 of float| `Float64 of float| `Uvint of int| `Svint of int| `String of string| `Array of (node_tag * tree array) option| `Tuple of tree array| `Record of (string option * hash * tree) array| `Num_variant of int * tree option| `Variant of string option * hash * tree option| `Table of ((string option * hash * node_tag) array * tree array array) option
]Tree representing serialized data, useful for testing and for untyped transformations.
Serialization of a tree to a buffer.
Deserialization of a tree from a buffer.
Deserialization of a tree from a string.
Prints a human-readable representation of the data into a string.
Prints a human-readable representation of the data to stdout.
Prints a human-readable representation of the data to an out_channel.
Check that certain low-level hacks work as expected