package octez-l2-libs

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

Module Tezos_scoru_wasm_durable_snapshot.DurableSource

Sourcetype t

t allows a wrapped_tree to be manipulated as a tree of chunked_byte_vector

Sourceexception Invalid_key of string

key was too long, or contained invalid steps.

Sourceexception Index_too_large of int

Invalid index for a subkey

Sourceexception Value_not_found

A value was not found in the durable store.

Sourceexception Tree_not_found

A tree does not exists under key in the durable store.

Sourceexception Out_of_bounds of int64 * int64

Attempted to write/read to/from a value at offset, beyond the limit.

Sourceexception Durable_empty

Durable_storage.t was empty.

Sourceexception Readonly_value

Cannot modify a readonly value.

Sourceexception IO_too_large

Cannot read from or write to more than 2,048 bytes

encoding is a Tezos_tree_encoding for t.

Sourcetype key

key is the type that indexes t. It enforces several constraints:

  • a key's length is bounded.
  • a key is a series of non-empty steps, where
  • a step is preceded by '/'
  • a step only contains alphanumeric ascii, or dots ('.')
Sourceval max_key_length : int

max_key_length is the maximum length of a key in bytes.

Sourceval key_of_string_exn : string -> key
Sourceval key_of_string_opt : string -> key option
Sourceval find_value : t -> key -> Tezos_lazy_containers.Chunked_byte_vector.t option Lwt.t

find_value durable key optionally looks for the value encoded at key in durable.

Sourceval find_value_exn : t -> key -> Tezos_lazy_containers.Chunked_byte_vector.t Lwt.t
Sourceval copy_tree_exn : t -> ?edit_readonly:bool -> key -> key -> t Lwt.t

copy_tree_exn tree ?edit_readonly from_key to_key produces a new tree in which a copy of the entire subtree at from_key is copied to to_key.

~edit_readonly:true allows a tree to be copied into a readonly location.

Sourceval move_tree_exn : t -> key -> key -> t Lwt.t

move_tree_exn tree from_key to_key produces a new tree in which the entire subtree at from_key is moved to to_key.

Sourceval list : t -> key -> string list Lwt.t

list durable key returns the subkeys under key.

Sourceval count_subtrees : t -> key -> int Lwt.t

count_subtrees durable key returns the number of subtrees under key.

Sourceval subtree_name_at : t -> key -> int -> string Lwt.t

subtree_name_at durable key n returns the name of the n_th subtree under key.

Sourceval delete : ?edit_readonly:bool -> t -> key -> t Lwt.t

delete ?edit_readonly durable key deletes the value at and/or subtrees of key.

  • raises Readonly_value

    when edit_readonly is not set while trying to edit the readonly section.

Sourceval hash : t -> key -> Tezos_base.TzPervasives.Context_hash.t option Lwt.t

hash durable key retrieves the tree hash of the value at the given key. This is not the same as the hash of the value.

Sourceval hash_exn : t -> key -> Tezos_base.TzPervasives.Context_hash.t Lwt.t

hash_exn durable key retrieves the tree hash of the value at the given key. This is not the same as the hash of the value.

Sourceval set_value_exn : t -> ?edit_readonly:bool -> key -> string -> t Lwt.t

set_value_exn durable key str installs the value str in durable under key, replacing any previous contents under this key without fetching it.

Sourceval write_value_exn : t -> ?edit_readonly:bool -> key -> int64 -> string -> t Lwt.t

write_value_exn durable ?edit_readonly key offset bytes writes bytes to key, starting at the given offset.

If no value at key exists, it is created.

~edit_readonly:true allows a value to be written into a readonly location.

  • raises Readonly_value

    iff edit_readonly is not set to true when attempting to write in the readonly section.

Sourceval read_value_exn : t -> key -> int64 -> int64 -> string Lwt.t

read_value_exn durable key offset max_bytes reads up to max_bytes bytes from the value at key, starting at the given offset.

Sourcemodule Internal_for_tests : sig ... end
OCaml

Innovation. Community. Security.