package orsetto
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=81283687ce3204263bc955a332dd7b90bf5b648a990c01160f33aaa77d80962f
md5=7346293aa013c2a8974c6fb7c521166a
doc/orsetto.cbor/Cbor_encode/Opaque/index.html
Module Cbor_encode.Opaque
A submodule containing logic for encoding CBOR messages from values of type Cf_type.opaque according to optional mode selectors.
val mode : ?strings:[< `Octets | `Text ] -> unit -> modeUse mode () to create a mode selector record for the opaque value encoder. Use any of the various optional parameters to set a mode selector to other than its default value. The modes are as follows:
strings: Controls how OCaml strings are encoded. The default is octets.
val value : ?mode:mode -> Cf_type.opaque -> unit tUse value v to create the CBOR encoding of the opaque value v provided it was witnessed by a type valid for output. The following table describes the runtime type indications required for values emitted.
Scalars:
Cf_type.Unit: nullCf_type.Bool: booleanCf_type.Int: integerCf_type.Int32: integerCf_type.Int64: integerCf_type.Float: integerCf_type.String: octets (or text if mode.strings = `Text)Ucs_type.Text: text
Containers:
Cf_type.(Seq {i nym}): arrayCf_type.(Seq (Pair ({i nym}, {i nym}))): mapCbor_type.(Tag ({i nym})): tag
...and...
Cf_type.Opaque: any of the above
Use the ~mode parameter to select modes other than the default.
Raises Invalid_argument if the witnessed type is not valid for output as a CBOR value.
val model : mode -> Cf_type.opaque Cf_data_render.modelUse model mode to make a modified primitive data render model for opaque values that uses mode to control its output formatting.