Module Mavkit_injector.Disk_persistence

type Mavryk_base.TzPervasives.error +=
  1. | Cannot_write_file of string
  2. | Cannot_create_dir of string
  3. | Cannot_read_file of string
  4. | Io_error of [ `Close | `Open ] Mavryk_stdlib_unix.Lwt_utils_unix.io_error
  5. | Unix_error of Unix.error
  6. | Decoding_error of Mavryk_base.TzPervasives.Data_encoding.Binary.read_error
val maybe_read_value : warn: (string -> Mavryk_base.TzPervasives.error Mavryk_base.TzPervasives.trace -> unit Lwt.t) -> string -> 'a Mavryk_base.TzPervasives.Data_encoding.t -> 'a option Lwt.t

maybe_read_value ~warn filename encoding reads the value with encoding from the file filename. It returns None if it fails to read a value and will emit a warning with the warn function in this case.

val write_value : string -> 'a Mavryk_base.TzPervasives.Data_encoding.t -> 'a -> (unit, Mavryk_base.TzPervasives.error Mavryk_base.TzPervasives.trace) Stdlib.result Lwt.t

write_value filename encoding v write the value v to the file filename in binary form following the encoding.

module type H = sig ... end

Signature for hash tables with additional information

module Make_table (H : H) : sig ... end

Create an on-disk persistent version of Hashtbl.

module Make_queue (N : sig ... end) (K : Mavryk_crypto.Intfs.HASH) (V : sig ... end) : sig ... end

Create an on-disk persistent version of the Hash_queue data structure.