package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.1.tar.gz
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a

doc/octez-libs.lazy-containers/Tezos_lazy_containers/Immutable_chunked_byte_vector/index.html

Module Tezos_lazy_containers.Immutable_chunked_byte_vectorSource

Sourceexception Bounds
Sourceexception SizeOverflow
Sourcemodule Chunk : sig ... end
Sourcetype t

Chunked byte vector

Sourceval create : ?origin:Tezos_tree_encoding.wrapped_tree -> ?get_chunk:(int64 -> Chunk.t Lwt.t) -> int64 -> t

create length creates a chunked byte vector that has capacity for length bytes.

Note: This function is expected to be used only by the tree-encoding library. To create a brand new chunked byte vector, use allocate.

origin vec returns the tree of origin of the vector, if it exists.

Note: The sole consumer of this function is expected to be the tree-encoding library.

Sourceval allocate : int64 -> t

allocate len creates a new zeroed chunked byte vector.

Note: This function may be dangerous to use in a tick if len is too large.

Sourceval of_string : string -> t

of_string str creates a chunked byte vector from the given str.

Sourceval of_bytes : bytes -> t

of_bytes bytes creates a chunked byte vector from the given bytes. The underlying memory is effectively copied - further modifications to bytes are not reflected in the chunked byte vector. Use this over of_string when turning your bytes into a string would be potentially expensive.

Sourceval to_string : t -> string Lwt.t

to_string vector creates a string from the given vector.

Sourceval to_bytes : t -> bytes Lwt.t

to_bytes vector creates a bytes from the given vector.

Sourceval grow : t -> int64 -> t

grow vector length_delta creates a new vector with the byte vector length increased by length_delta and initializes the memory with empty chunks.

Note: This function may be dangerous to use in a tick if length_delta is too large.

Sourceval length : t -> int64

length vector returns the length of vector in bytes.

Sourceval load_byte : t -> int64 -> int Lwt.t

load_byte vector offset read the byte at offset.

Sourceval load_bytes : t -> int64 -> int64 -> bytes Lwt.t

load_bytes vector offset num_bytes loads the bytes at offset to offset + num_bytes.

Note: This function may be dangerous to use in a tick if num_bytes is too large.

Sourceval store_byte : t -> int64 -> int -> t Lwt.t

store_byte vector offset byte creates a new vector with the byte at offset set to byte.

Sourceval store_bytes : t -> int64 -> bytes -> t Lwt.t

store_bytes vector offset bytes creates a new vector with the bytes from offset set to the given bytes.

Sourceval loaded_chunks : t -> (int64 * Chunk.t option) list

loaded_chunks vector returns the chunks of vector that have been cached in-memory since vector has been created, either by reading its contents, or by writing to those chunks.

encoding is a Tezos_tree_encoding for t.

OCaml

Innovation. Community. Security.