package octez-l2-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a
doc/octez-l2-libs.webassembly-interpreter/Tezos_webassembly_interpreter/Input_buffer/index.html
Module Tezos_webassembly_interpreter.Input_buffer
This module implements a FIFO queue to model the input. The messages are queued in an input_buffer in their order of appearance in the inbox.
val pp_message :
Ppx_deriving_runtime.Format.formatter ->
message ->
Ppx_deriving_runtime.unit
val show_message : message -> Ppx_deriving_runtime.string
An element of type t will have a content which is a lazy_vector of messages and a pointer to the number of elements to be able to dequeue. At this point there is no cleanup operation so an input_buffer content will likely have more than num_elements
messages (see #3340).
val alloc : unit -> t
alloc ()
returns an empty input_buffer.
num_elements buffer
is the number of elements of buffer
. It is used by dequeue
to pick the current message. Note that it is not necessarily equal to the length of the content of the inbox (see #3340).
val reset : t -> unit
reset buffer
removes the current contents of the buffer.
dequeue buffer
pops the current message from buffer and returns it. Note that the input buffer models a FIFO queue so the current message is the oldest in the queue. If the queue is empty it raises Dequeue_from_empty_queue
.
enqueue buffer message
pushes the given message
into the buffer
. Note that the message will have to have a higher raw_level/message_counter than than the newest message in the queue. If that fails it will raise the error Cannot_store_an_earlier_message
.