aboutsummaryrefslogtreecommitdiffstats
path: root/lib/system.ml
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-05-23 00:12:07 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-05-23 00:13:22 +0000
commit1fc15b6fe762343f05b052682977d2d3080d1043 (patch)
treeb2f6a3678e2eec44f43ae7dc70346d11a7068310 /lib/system.ml
parent614700914d13c8762a2af7a779d808a240e99ee6 (diff)
downloadSakura-1fc15b6fe762343f05b052682977d2d3080d1043.tar.gz
Sakura-1fc15b6fe762343f05b052682977d2d3080d1043.zip
Migrate `Configuration` over
Diffstat (limited to 'lib/system.ml')
-rw-r--r--lib/system.ml10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/system.ml b/lib/system.ml
index bad6c3b..716b6a8 100644
--- a/lib/system.ml
+++ b/lib/system.ml
@@ -9,8 +9,8 @@ type transport_parcel =
(module Transport.TRANSPORT with type t = 't) * 't
-> transport_parcel
-type nt_provider = Sexplib.Sexp.t -> (nt_parcel, string) result
-type transport_provider = Sexplib.Sexp.t -> (transport_parcel, string) result
+type nt_provider = Sexplib.Sexp.t -> (nt_parcel, Condition.t) result
+type transport_provider = Sexplib.Sexp.t -> (transport_parcel, Condition.t) result
type registry = {
nt : nt_provider Utilities.StringMap.t;
@@ -44,7 +44,7 @@ let registry : registry =
Ok (TransportParcel ((module Transport.TCP), transport)));
}
-let assemble (config : Configuration.t) : (unit -> unit, string) result =
+let assemble (config : Configuration.t) : (unit -> unit, Condition.t) result =
let open Utilities.Result in
let* nt_tag, nt_body =
Configuration.require_section ~name:"nt"
@@ -71,11 +71,11 @@ let assemble (config : Configuration.t) : (unit -> unit, string) result =
let* packed_transport = transport_provider transport_body in
let (NtParcel (module NT)) = packed_nt in
let (TransportParcel ((module T), transport)) = packed_transport in
- let* () = NT.initialize () |> Result.map_error Nt.string_of_error in
+ let* () = NT.initialize () in
let module L = Listener.Make (T) (NT) in
Ok (fun () -> L.run transport)
-let run_from_config (path : string) : (unit -> unit, string) result =
+let run_from_config (path : string) : (unit -> unit, Condition.t) result =
let ( let* ) = Result.bind in
let* config =
Configuration.load ~expected_keys:[ "nt"; "transport" ] path