rm non-NBO Bin.t; rename time modules
This commit is contained in:
parent
7053607c72
commit
104666b7ea
13 changed files with 306 additions and 359 deletions
12
src/time.ml
12
src/time.ml
|
|
@ -1,6 +1,6 @@
|
|||
let uint64_max = Int64.minus_one
|
||||
|
||||
module Relative = struct
|
||||
module TimeRelative = struct
|
||||
type t = Int64.t
|
||||
|
||||
let forever = uint64_max
|
||||
|
|
@ -26,8 +26,7 @@ module Relative = struct
|
|||
let v = Int64.mul s 1_000_000L in
|
||||
if Int64.unsigned_div v 1_000_000L <> s then forever else v
|
||||
|
||||
let bin = Bin.neint64
|
||||
let bin_nbo = Bin.beint64
|
||||
let bin = Bin.beint64
|
||||
|
||||
let caqti =
|
||||
let encode v = Ok v in
|
||||
|
|
@ -57,7 +56,7 @@ module Relative = struct
|
|||
|> Jsont.Object.finish
|
||||
end
|
||||
|
||||
module Absolute = struct
|
||||
module TimeAbsolute = struct
|
||||
type t = Int64.t
|
||||
|
||||
let never = uint64_max
|
||||
|
|
@ -117,9 +116,8 @@ module Timestamp = struct
|
|||
let of_absolute a =
|
||||
if a = never then never else Int64.sub a (Int64.unsigned_rem a 1_000_000L)
|
||||
|
||||
let of_ptime v = v |> Absolute.of_ptime |> of_absolute
|
||||
let bin = Bin.neint64
|
||||
let bin_nbo = Bin.beint64
|
||||
let of_ptime v = v |> TimeAbsolute.of_ptime |> of_absolute
|
||||
let bin = Bin.beint64
|
||||
|
||||
let caqti =
|
||||
let encode v = Ok v in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue