This commit is contained in:
swrup 2026-02-05 15:31:49 +01:00
parent 5eba5f2265
commit 7a28fb55ca
17 changed files with 325 additions and 314 deletions

54
src/time.mli Normal file
View file

@ -0,0 +1,54 @@
module Relative : sig
type t
val forever : t
val zero : t
val compare : t -> t -> int
val min : t -> t -> t
val max : t -> t -> t
val add : t -> t -> t
val sub : t -> t -> t
val of_s : int64 -> t
(* - *)
val bin : t Bin.t
val bin_nbo : t Bin.t
val caqti : t Caqti_type.t
val jsont : t Jsont.t
end
module Absolute : sig
type t
val never : t
val zero : t
val compare : t -> t -> int
val min : t -> t -> t
val max : t -> t -> t
val diff : t -> t -> Relative.t
val add : t -> Relative.t -> t
val sub : t -> Relative.t -> t
val of_s : int64 -> t
val of_ptime : Ptime.t -> t
end
module Timestamp : sig
type t
val never : t
val zero : t
val compare : t -> t -> int
val diff : t -> t -> Relative.t
val of_s : int64 -> t
(* none if t = never *)
val to_s : t -> int64 option
val of_absolute : Absolute.t -> t
val of_ptime : Ptime.t -> t
(* - *)
val bin : t Bin.t
val bin_nbo : t Bin.t
val caqti : t Caqti_type.t
val jsont : t Jsont.t
end