Parameter Of_storage.M

Parameters

module Key : Type.S
module Value : Type.S

Signature

type t
type key = Key.t
type value = Value.t
val init : Conf.t -> t

init config initialises a storage layer, with the configuration config.

val mem : t -> key -> bool

mem t k is true iff k is present in t.

val find : t -> key -> value option

find t k is Some v if k is associated to v in t and None is k is not present in t.

val keys : t -> key list

keys t it the list of keys in t.

val set : t -> key -> value -> unit

set t k v sets the contents of k to v in t.

val remove : t -> key -> unit

remove t k removes the key k in t.

val batch : t -> (t -> 'a) -> 'a

batch t f applies the operations in f in a batch. The exact guarantees depend on the implementation.

val clear : t -> unit

clear t clears the storage. This operation is expected to be slow.

val close : t -> unit

close t frees up all the resources associated with t.