From 9991be9aeea6bc78b60603343e04245d374cbb93 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 6 Nov 2018 22:16:13 +0100 Subject: sid: add Sid.{of,to}_bytes aliases Establish symmetry with of_string / to_string and the StringFmt module. --- sid.ml | 3 +++ sid.mli | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/sid.ml b/sid.ml index 2cced76..38c97f2 100644 --- a/sid.ml +++ b/sid.ml @@ -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 diff --git a/sid.mli b/sid.mli index 8c3a5fa..69a439e 100644 --- a/sid.mli +++ b/sid.mli @@ -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]. *) + -- cgit v1.2.3