package octez-l2-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type +'a t

The type for representing storage backends that can be accessed by the module. The type parameter indicates whether the storage can be only read or both read and written.

val name : string

name is the name of the store.

make_key_path path raw_key constructs a new path from path and the raw_key key_path_representation.

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

load location loads the backend storage from location.

val flush : [> `Write ] t -> unit Tezos_base.TzPervasives.tzresult

flush location flushes to disk a sequence of changes to the data stored at location.

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

close t closes the storage backend t.

val set : [> `Write ] t -> Store_sigs.path -> bytes -> unit Tezos_base.TzPervasives.tzresult Lwt.t

set_exn t path b sets the contents for the store t at path to the sequence of bytes b. The write operation can fail, in which case an exception is thrown.

val get : [> `Read ] t -> Store_sigs.path -> bytes Tezos_base.TzPervasives.tzresult Lwt.t

get t path returns the contents for the store t at the location indicated by path. It can fail if t does not have any content stored at path.

val mem : [> `Read ] t -> Store_sigs.path -> bool Tezos_base.TzPervasives.tzresult Lwt.t

mem t path returns whether the storage backend t contains any data at the location indicated by path.

val find : [> `Read ] t -> Store_sigs.path -> bytes option Tezos_base.TzPervasives.tzresult Lwt.t

find t path is the same as get t path, except that an optional value is returned. This value is None if the backend storage t does not have any content stored at location path.

val path_to_string : Store_sigs.path -> string

path_to_string converts a path to a string.

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

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

OCaml

Innovation. Community. Security.