package tezos-protocol-013-PtJakart
Parameters
module _ : sig ... end
Signature
A cell in the skip list carrying a given 'content
and back pointers of type 'ptr
.
val encoding :
'ptr Tezos_protocol_environment_013_PtJakart.Data_encoding.t ->
'content Tezos_protocol_environment_013_PtJakart.Data_encoding.t ->
('content, 'ptr) cell Tezos_protocol_environment_013_PtJakart.Data_encoding.t
val index : (_, _) cell -> int
index cell
returns the position of cell
in the sequence.
val content : ('content, 'ptr) cell -> 'content
content cell
is the content carried by the cell
.
val back_pointer : ('content, 'ptr) cell -> int -> 'ptr option
back_pointer cell i
returns Some ptr
if ptr
is the i
-th back pointer of cell
. Returns None
if the cell contains less than i + 1
back pointers.
val back_pointers : ('content, 'ptr) cell -> 'ptr list
back_pointers cell
returns the back pointers of cell
.
val genesis : 'content -> ('content, 'ptr) cell
genesis content
is the first cell of a skip list. It has no back pointers.
val next :
prev_cell:('content, 'ptr) cell ->
prev_cell_ptr:'ptr ->
'content ->
('content, 'ptr) cell
next ~prev_cell ~prev_cell_ptr content
creates a new cell that carries some content
, that follows prev_cell
.
val back_path :
deref:('ptr -> ('content, 'ptr) cell option) ->
cell_ptr:'ptr ->
target_index:int ->
'ptr list option
back_path ~deref ~cell_ptr ~target_index
returns Some path
where path
is a sequence of back pointers to traverse to go from cell_ptr
to the cell at position target_index
in the sequence denoted by (deref, cell_ptr)
.
val valid_back_path :
equal_ptr:('ptr -> 'ptr -> bool) ->
deref:('ptr -> ('content, 'ptr) cell option) ->
cell_ptr:'ptr ->
target_ptr:'ptr ->
'ptr list ->
bool
valid_back_path ~equal_ptr ~deref ~cell_ptr ~target_ptr path
returns true
iff path
is a valid and minimal path from cell_ptr
to target_ptr
in the skip list denoted by (deref, cell_ptr)
.