package octez-injector

  1. Overview
  2. Docs

Module Disk_persistence.Make_tableSource

Create an on-disk persistent version of Hashtbl.

Parameters

module H : H

Signature

Sourcetype key = H.key
Sourcetype value = H.value
Sourcetype t

Type of persistent hash tables

Sourceval replace : t -> key -> value -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Persistent version of H.replace

Sourceval remove : t -> key -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Persistent version of H.remove

Sourceval find : t -> key -> value option

Same as H.find

Sourceval mem : t -> key -> bool

Same as H.mem

Sourceval iter_s : (key -> value -> unit Lwt.t) -> t -> unit Lwt.t

Same as H.iter_s

Sourceval iter_es : (key -> value -> unit Tezos_base.TzPervasives.tzresult Lwt.t) -> t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Same as H.iter_es

Sourceval fold : (key -> value -> 'a -> 'a) -> t -> 'a -> 'a

Same as H.fold

Sourceval length : t -> int

Same as H.length

Sourceval replace_seq : t -> (key * value) Tezos_base.TzPervasives.Seq.t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Persistent version of H.replace_seq

Sourceval load_from_disk : warn_unreadable: (string -> Tezos_base.TzPervasives.error Tezos_base.TzPervasives.trace -> unit Lwt.t) option -> initial_size:int -> data_dir:string -> filter:(value -> bool) -> t Tezos_base.TzPervasives.tzresult Lwt.t

load_from_disk ~warn_unreadable ~initial_size ~data_dir creates a hash table of size initial_size. The hash table is populated by persistent elements present in data_dir/H.name which pass the filter (the directory is created if it does not exist). If warn_unreadable is Some warn, unreadable files are ignored but a warning is printed with warn, otherwise the loading fails on the first unreadable file.

OCaml

Innovation. Community. Security.