Skip to content

Commit

Permalink
Hygiene: Expose ListStorageType
Browse files Browse the repository at this point in the history
Capnp.MessageSig.S is public (aka. part of wrapped capnp.ml), and has a ListStorage module.

But ListStorage.t has a storage_type field of type 'Capnp.MessageSig.ListStorageType.t' that is not public.

This commit makes ListStorageType public.
  • Loading branch information
jonahbeckford committed Nov 15, 2024
1 parent 20f34db commit 7e37b41
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/runtime/capnp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module Array = CArray
module BytesStorage = BytesStorage
module BytesMessage = Message.BytesMessage
module Codecs = Codecs
module ListStorageType = ListStorageType
module RPC = RPC
module Runtime = struct
module BuilderInc = BuilderInc
Expand Down
10 changes: 0 additions & 10 deletions src/runtime/listStorageType.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,13 @@ let sizeof_uint64 = 8

type t =
| Empty
(** list(void), no storage required *)

| Bit
(** list(bool), tightly packed bits *)

| Bytes1
| Bytes2
| Bytes4
| Bytes8
(** either primitive values or a data-only struct *)

| Pointer
(** either a pointer to an external object, or a pointer-only struct *)

| Composite of int * int
(** typical struct; parameters are per-element word size for data section
and pointers section, respectively *)

let get_byte_count storage_type =
match storage_type with
Expand Down
23 changes: 23 additions & 0 deletions src/runtime/listStorageType.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(** @canonical Capnp.ListStorageType *)

type t =
| Empty
(** list(void), no storage required *)

| Bit
(** list(bool), tightly packed bits *)

| Bytes1
| Bytes2
| Bytes4
| Bytes8
(** either primitive values or a data-only struct *)

| Pointer
(** either a pointer to an external object, or a pointer-only struct *)

| Composite of int * int
(** typical struct; parameters are per-element word size for data section
and pointers section, respectively *)

val get_byte_count : t -> int

0 comments on commit 7e37b41

Please sign in to comment.