package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-libs.lazy-containers/Tezos_lazy_containers/Immutable_chunked_byte_vector/index.html
Module Tezos_lazy_containers.Immutable_chunked_byte_vector
Source
Chunked byte vector
val 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.
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.
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.
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.
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.
store_byte vector offset byte
creates a new vector with the byte at offset
set to byte
.
store_bytes vector offset bytes
creates a new vector with the bytes from offset
set to the given bytes
.
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
.