Cbor_encode.OpaqueA 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: textContainers:
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 aboveUse 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.