package octez-l2-libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Indexed_store.Make_indexableSource

Parameters

module _ : NAME
module K : Index.Key.S
module V : Index.Value.S

Signature

Sourcetype +'a t

The type of store built on indexes.

Sourceval load : path:string -> 'a Store_sigs.mode -> 'a t Tezos_base.TzPervasives.tzresult Lwt.t

Load (or initializes) a store in the file path. If readonly is true, the store will only be accessed in read only mode.

Sourceval mem : [> `Read ] t -> K.t -> bool Tezos_base.TzPervasives.tzresult Lwt.t

Returns true if the key has a value associated in the store.

Sourceval find : [> `Read ] t -> K.t -> V.t option Tezos_base.TzPervasives.tzresult Lwt.t

Returns the value associated to a key in the store, or None otherwise.

Sourceval add : ?flush:bool -> [> `Write ] t -> K.t -> V.t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Add an association from a key to a value in the store. If flush (default to true) is set, the index is written on disk right away.

Sourceval close : _ t -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Closes the store. After this call the store cannot be accessed anymore (unless one calls load again).

Sourceval readonly : [> `Read ] t -> [ `Read ] t

readonly t returns a read only version of the store t.

OCaml

Innovation. Community. Security.