Serialkit_toml.Toml
TOML definitions and codec.
module Meta : sig ... end
TOML node metadata.
type 'a node = 'a * Meta.t
The type for data nodes. The node and its metadata.
The type for time zone offsets between local and UTC timelines in seconds. This is the signed difference in seconds between the local timeline and the UTC timeline.
type time = (int * int * int) * float option * tz_offset_s option
module Error : sig ... end
Decoding errors.
val of_string :
?file:Serialkit_text.Tloc.fpath ->
string ->
(t, Error.t) Stdlib.result
of_string s
parses TOML from s
with the following limitations:
Note. All OCaml strings returned by this function are UTF-8 encoded.
val of_string' :
?pp_error:Error.t fmt ->
?file:Serialkit_text.Tloc.fpath ->
string ->
(t, string) Stdlib.result
of_string'
is of_string
composed with error_to_string
.
val to_string : t -> string
to_string t
is t
as TOML.
Warning. Assumes all OCaml strings in t
are UTF-8 encoded.
The type for TOML indexing operations.
Nth n
, lookup zero-based element n
in a list. If n
is negative, counts the number of elements from the end of the list, i.e. -1
is the last list element.Key k
, lookup binding k
in an s-expression dictionary.val pp_key : string fmt
pp_key
formats a key, this is Format
.pp_print_string.
pp_index
formats indices. Keys are unbracketed and formatted with pp_key
, defaults to pp_key
.
type path = index list
The type for paths, a sequence of indexing operations in reverse order.
val path_of_string : string -> (path, string) Stdlib.result
path_of_string
parses a path from s
according to the syntax given here.
pp_path ?pp_key ()
is a formatter for paths using pp_key
to format keys (defaults to pp_key
).
The type for carets. A caret location and the path at which it applies.
val caret_of_string : string -> (caret, string) Stdlib.result
caret_of_string s
parses a caret from s
according to the syntax given here.