package coq-core

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val magic_number : int32
type 'a segment = private {
  1. name : string;
  2. pos : int64;
  3. len : int64;
  4. hash : Digest.t;
}
type 'a id = private {
  1. id : string;
}

Private to ensure the phantom tag is injective

type in_handle
type out_handle
val make_id : string -> 'a id
val open_in : file:string -> in_handle
val close_in : in_handle -> unit
val marshal_in_segment : in_handle -> segment:'a id -> 'a * Digest.t
val get_segment : in_handle -> segment:'a id -> 'a segment
val open_out : file:string -> out_handle
val close_out : out_handle -> unit
val marshal_out_segment : out_handle -> segment:'a id -> 'a -> unit
val marshal_out_binary : out_handle -> segment:'a id -> out_channel * (unit -> unit)

marshal_out_binary oh segment is a low level, stateful, API returning oc, stop. Once called no other API can be used on the same oh and only Stdlib.output_* APIs should be used on oc. stop () must be invoked in order to signal that all data was written to oc (which should not be used afterwards). Only after calling stop the other API can be used on oh.

OCaml

Innovation. Community. Security.