From 639b4c0c5c77496822040087cda287189846d88b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Sat, 25 Feb 2017 18:01:21 +0100 Subject: [PATCH] Shell: add `Data_encoding.unit` --- src/minutils/data_encoding.ml | 1 + src/minutils/data_encoding.mli | 1 + src/proto/environment/data_encoding.mli | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/minutils/data_encoding.ml b/src/minutils/data_encoding.ml index 2da130d06..1507196b9 100644 --- a/src/minutils/data_encoding.ml +++ b/src/minutils/data_encoding.ml @@ -427,6 +427,7 @@ module Encoding = struct let null = make @@ Null let empty = make @@ Empty + let unit = make @@ Ignore let constant s = make @@ Constant s let bool = make @@ Bool let int8 = make @@ Int8 diff --git a/src/minutils/data_encoding.mli b/src/minutils/data_encoding.mli index b0e84dc36..98adf1588 100644 --- a/src/minutils/data_encoding.mli +++ b/src/minutils/data_encoding.mli @@ -33,6 +33,7 @@ val splitted : json:'a encoding -> binary:'a encoding -> 'a encoding val null : unit encoding val empty : unit encoding +val unit : unit encoding val constant : string -> unit encoding val int8 : int encoding val uint8 : int encoding diff --git a/src/proto/environment/data_encoding.mli b/src/proto/environment/data_encoding.mli index 736ff8874..d13ff0e01 100644 --- a/src/proto/environment/data_encoding.mli +++ b/src/proto/environment/data_encoding.mli @@ -25,6 +25,7 @@ val splitted : json:'a encoding -> binary:'a encoding -> 'a encoding val null : unit encoding val empty : unit encoding +val unit : unit encoding val constant : string -> unit encoding val int8 : int encoding val int16 : int encoding @@ -219,6 +220,7 @@ end module Binary : sig val length : 'a encoding -> 'a -> int + val fixed_length : 'a encoding -> int option val read : 'a encoding -> MBytes.t -> int -> int -> (int * 'a) option val write : 'a encoding -> 'a -> MBytes.t -> int -> int option val to_bytes : 'a encoding -> 'a -> MBytes.t