Module Omod_support.Codec
Value serializers.
The underlying implementation uses Marshal
with magic numbers that depend on omod and OCaml's versions.
val v : id:string -> 'a t
v ~id
is a new codec with identifierid
(part of the magic number).
val write : 'a t -> Omod.fpath -> 'a -> (unit, string) Stdlib.result
write c file v
writes valuev
tofile
using codecc
.
val read : 'a t -> Omod.fpath -> ('a, string) Stdlib.result
read c file
reads a value fromfile
using codecc
.