storage_buffer.bend checks
raw source on the hub · import stelliferous@0.0.4.0/storage_buffer.bend as Storage_buffer
Shared affine storage operations. Shape descriptors do not own another buffer.
3 imports
import Base import ./traversal_array.bend as Traversal import ./proofs/storage_certificate.bend as Certificate
Types
type Buffer source · line 6 · raw
@-Element:Data -> Type
Buffer@-Element:Data -> @storage:Array<Element> -> @length:Nat -> @certificate:0xa2af805348d03b11eb853850859654f6/proofs/storage_certificate.Certificate<Element, storage> -> Buffer<Element>
Definitions
def bit_length source · line 46 · raw
@remaining_bits:Nat -> @+value:U32 -> Nat
At most 32 word steps, independent of the allocation length.
def allocation_depth source · line 54 · raw
@length:U32 -> Nat
Positive requested lengths round to the next power-of-two capacity. The caller establishes the machine allocation limit before calling Array.new.
def significant_bits source · line 59 · raw
@remaining:Nat -> @+value:U32 -> @+bits:Nat -> @zero:Bool -> Nat
Shared runtime depth calculation. The tail call stops at the significant word bits; allocation_depth remains the arithmetic model used by proofs.
def depth_for source · line 67 · raw
@+count:U32 -> Nat
Templates
template allocate source · line 10 · raw
@-Element:Data -> @+depth:Nat -> @+value:Element -> @length:Nat -> Buffer<Element>
Construction records evidence once, without visiting the owner.
template write source · line 14 · raw
@-Element:Data -> @+index:U32 -> @value:Element -> @buffer:Buffer<Element> -> Buffer<Element>
One value written at index; the certificate follows the storage.
template write_at source · line 20 · raw
@-Element:Data -> @values:List<&2, Element> -> @+offset:U32 -> @buffer:Buffer<Element> -> Buffer<Element>
The values written from the offset on, one write a value: the list is read once.
template from_list source · line 25 · raw
@-Element:Data -> @values:List<&2, Element> -> @+depth:Nat -> @+fallback:Element -> @length:Nat -> Buffer<Element>
template write_exactly source · line 30 · raw
@-Element:Data -> @values:List<&2, Element> -> @+offset:U32 -> @expected:Nat -> @buffer:Buffer<Element> -> Pair(Buffer<Element>, Bool)
The values written from the offset on while expected lasts, and whether the list held exactly expected values. A longer list stops being written there.
template capacity source · line 37 · raw
@-Element:Data -> @-storage:Array<Element> -> @certificate:0xa2af805348d03b11eb853850859654f6/proofs/storage_certificate.Certificate<Element, storage> -> U32
template bind_pair source · line 41 · raw
@-First:Type -> @-Second:Type -> @-Result:Type -> @pair:Pair(First, Second) -> @body:(@_:First -> @_:Second -> Result) -> Result
template write_list source · line 71 · raw
@-Element:Data -> @values:List<&2, Element> -> @+offset:U32 -> @storage:Array<Element> -> Array<Element>
template read_list source · line 74 · raw
@-Element:Data -> @count:Nat -> @+offset:U32 -> @storage:Array<Element> -> List<&2, Element>
template read_when source · line 81 · raw
@-Element:Data -> @fallback:Element -> @valid:Bool -> @storage:Array<Element> -> @index:U32 -> Pair(Array<Element>, Element)
template read_sized source · line 86 · raw
@-Element:Data -> @fallback:Element -> @+index:U32 -> @+logical_length:U32 -> @sized:Pair(Array<Element>, U32) -> Pair(Array<Element>, Element)
template read_or source · line 90 · raw
@-Element:Data -> @fallback:Element -> @storage:Array<Element> -> @index:U32 -> @logical_length:U32 -> Pair(Array<Element>, Element)
template read_result source · line 93 · raw
@-Element:Data -> @length:Nat -> @result:Pair(Array<Element>, Element) -> @certificate:0xa2af805348d03b11eb853850859654f6/proofs/storage_certificate.Certificate<Element, Pair.fst(Array<Element>, Element, result)> -> Pair(Buffer<Element>, Element)
template read source · line 98 · raw
@-Element:Data -> @buffer:Buffer<Element> -> @+index:U32 -> Pair(Buffer<Element>, Element)
template read_masked source · line 102 · raw
@-Element:Data -> @fallback:Element -> @valid:Bool -> @buffer:Buffer<Element> -> @index:U32 -> Pair(Buffer<Element>, Element)