Page
Library
Module
Module type
Parameter
Class
Class type
Source
Bi_io
SourceInput and output functions for the Biniou serialization format
Tag indicating a table node.
Tag indicating a shared node.
Write one-byte tag to a buffer.
Read one-byte tag from a buffer.
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
.
The write_untagged_
functions write an untagged value (VAL) to an output buffer while the other write_
functions write a tagged value (TAGVAL).
The read_untagged_
functions read an untagged value (VAL) from an input buffer.
Read and discard a value. Useful for skipping unknown record fields.
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