talircd/lib/server/import.ml

21 lines
499 B
OCaml

include Data
include Irc
type sockaddr = Unix.sockaddr
type fd = Lwt_unix.file_descr
let pp_sockaddr ppf = function
| Unix.ADDR_INET (adr, port) -> Fmt.pf ppf "%s:%d" (Unix.string_of_inet_addr adr) port
| Unix.ADDR_UNIX path -> Fmt.string ppf path
let pp_unixtime ppf t =
let dt = Ptime.diff t Ptime.epoch in
Fmt.pf ppf "%.0f" (Ptime.Span.to_float_s dt)
module Result_syntax = struct
let ( let* ) = Result.bind
let ( let+ ) r f = Result.map f r
end
include (val Logging.logs "Irc")