diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2018-11-06 22:16:13 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2018-11-06 22:16:18 +0100 |
commit | 9991be9aeea6bc78b60603343e04245d374cbb93 (patch) | |
tree | fb826753ea0a6672acba9db8a3cf32b97e858fe1 | |
parent | 5047b8e8d990d3d49943b48a311ac8e14b439523 (diff) | |
download | ocaml-sid-9991be9aeea6bc78b60603343e04245d374cbb93.tar.gz |
sid: add Sid.{of,to}_bytes aliases
Establish symmetry with of_string / to_string and the StringFmt module.
-rw-r--r-- | sid.ml | 3 | ||||
-rw-r--r-- | sid.mli | 6 |
2 files changed, 9 insertions, 0 deletions
@@ -398,4 +398,7 @@ end let of_string = StringFmt.decode let to_string = StringFmt.encode +let of_bytes = PacketRep.decode +let to_bytes = PacketRep.encode + type t = sid @@ -433,3 +433,9 @@ val of_string : string -> (t, string) result val to_string : t -> string (** [to_string s] is an alias for [StringFmt.encode s]. *) +val of_bytes : ?endian:PacketRep.endian -> bytes -> (t, string) result +(** [of_bytes endian b] is an alias for [PacketRep.decode endian b]. *) + +val to_bytes : ?endian:PacketRep.endian -> t -> bytes +(** [to_bytes endian b] is an alias for [PacketRep.encode endian b]. *) + |