···434 enc = (fun i -> Toml.String (Int64.to_string i));
435}
436437-(* ---- Internal datetime codecs (for structured datetime types) ---- *)
438-(* These are used internally but not exposed in the mli - only ptime codecs are public *)
439-440-let datetime_ = {
441- kind = "datetime";
442- doc = "";
443- dec = (function
444- | Toml.Datetime s ->
445- Result.map_error (fun msg -> Value_error msg) (Datetime.of_string s)
446- | v -> type_error ~expected:"datetime" v);
447- enc = (fun dt -> Toml.Datetime (Datetime.to_string dt));
448-}
449-450-let datetime_local_ = {
451- kind = "datetime-local";
452- doc = "";
453- dec = (function
454- | Toml.Datetime_local s ->
455- Result.map_error (fun msg -> Value_error msg) (Datetime_local.of_string s)
456- | v -> type_error ~expected:"datetime-local" v);
457- enc = (fun dt -> Toml.Datetime_local (Datetime_local.to_string dt));
458-}
459-460-let date_local_ = {
461- kind = "date-local";
462- doc = "";
463- dec = (function
464- | Toml.Date_local s ->
465- Result.map_error (fun msg -> Value_error msg) (Date.of_string s)
466- | v -> type_error ~expected:"date-local" v);
467- enc = (fun d -> Toml.Date_local (Date.to_string d));
468-}
469-470-let time_local_ = {
471- kind = "time-local";
472- doc = "";
473- dec = (function
474- | Toml.Time_local s ->
475- Result.map_error (fun msg -> Value_error msg) (Time.of_string s)
476- | v -> type_error ~expected:"time-local" v);
477- enc = (fun t -> Toml.Time_local (Time.to_string t));
478-}
479-480-(* Silence unused warnings for internal codecs *)
481-let _ = datetime_
482-let _ = datetime_local_
483-let _ = date_local_
484-let _ = time_local_
485-486(* ---- Ptime codecs ---- *)
487488(* Helper to get current timezone offset from explicit value or function *)
···1297 | None -> failwith "any: enc not provided");
1298 }
12991300-(* ---- Encoding and decoding ---- *)
1301-1302let to_tomlt_error e =
1303 Toml.Error.make (Toml.Error.Semantic (Toml.Error.Duplicate_key (codec_error_to_string e)))
1304···13111312let encode c v = c.enc v
13131314-(* Re-export the Toml module for accessing raw TOML values *)
1315module Toml = Toml
1316module Error = Toml.Error
···434 enc = (fun i -> Toml.String (Int64.to_string i));
435}
4360000000000000000000000000000000000000000000000000437(* ---- Ptime codecs ---- *)
438439(* Helper to get current timezone offset from explicit value or function *)
···1248 | None -> failwith "any: enc not provided");
1249 }
1250001251let to_tomlt_error e =
1252 Toml.Error.make (Toml.Error.Semantic (Toml.Error.Duplicate_key (codec_error_to_string e)))
1253···12601261let encode c v = c.enc v
126201263module Toml = Toml
1264module Error = Toml.Error