Skip to content

Commit bc9231c

Browse files
committed
Network: export exception in signature
1 parent dce3432 commit bc9231c

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

network.ml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ open Prelude
22

33
let () = assert (Sys.word_size = 64)
44

5-
(* reexport exceptions *)
6-
include (Devkit_ragel : sig
7-
exception Parse_ipv4 of string
8-
exception Parse_compact_duration of string
9-
end)
5+
(* reexport exception *)
6+
include (Devkit_ragel : sig exception Parse_ipv4 of string end)
107

118
type ipv4 = int32
129
type ipv4_cidr = int32 * int32

network.mli

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33
type ipv4
44
type ipv4_cidr
55

6+
exception Parse_ipv4 of string
7+
68
val ipv4_null : ipv4
79
val bytes_of_ipv4 : ipv4 -> int * int * int * int
810
val string_of_ipv4 : ipv4 -> string
11+
12+
(** @raise Parse_ipv4 if input is not an IP *)
913
val ipv4_of_string_exn : string -> ipv4
14+
15+
(** @return ip 0.0.0.0 when input is not an IP *)
1016
val ipv4_of_string_null : string -> ipv4
17+
1118
val ipv4_of_int32 : int32 -> ipv4
1219
val int32_of_ipv4 : ipv4 -> int32
1320
val is_ipv4_slow : string -> bool

time.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ type t = float
1111
(* duration in seconds *)
1212
type duration = float
1313

14+
include (Devkit_ragel : sig exception Parse_compact_duration of string end)
15+
1416
let compare = Float.compare
1517

1618
let get = Unix.gettimeofday

0 commit comments

Comments
 (0)