⌂ Modules nupp nupp.mem nupp.mem.array nupp.mem.array
Owned contiguous arrays of one scalar or struct type.
const array = nupp . mem . array
do
const values = array . scalar ( array . uint32 , 4 )
const writable = values : write ( )
writable [ 1 ] = 42
nupp . drop ( writable )
print ( values : read ( ) [ 1 ] )
end
The array owns its storage and releases it at the end of the scope that holds it. Reading and writing it are the nupp.mem.span operations, so every index is checked against the count the array carries.
Module contents Types Type Kind Description Arrayrecord Bytesrecord Owned bytes, with the same checked view vocabulary as scalar arrays. Scalarrecord
Functions Function Kind Description bytesfunction Allocates zeroed bytes without treating the storage-only uint8 as a value type. newArrayfunction Allocates zeroed storage with the struct witness's physical layout. scalarfunction Allocates zeroed storage for the selected scalar element type.
Types
Arrayrecord
record array . Array < T > ...
Type parameters
pointerfield
@private @readonly
readmethod
read : function ( borrows self : Array < T > ) : Span < T > borrows ( self )
Arguments Name Type Description borrows selfArray < T >
Returns Type Description Span < T > borrows ( self )
writemethod
write : function ( exclusive self : Array < T > ) : Writable < T > borrows ( self )
Arguments Name Type Description exclusive selfArray < T >
Returns Type Description Writable < T > borrows ( self )
Bytesrecord
Owned bytes, with the same checked view vocabulary as scalar arrays.
pointerfield
@private @readonly
readmethod
Arguments Name Type Description borrows selfany
Returns
writemethod
write : function write ( exclusive self ) : Writable < uint8 >
Arguments Name Type Description exclusive selfany
Returns Type Description Writable < uint8 >
Scalarrecord
Type parameters
physicalfield
@private @readonly
Functions
array.bytesfunction
Allocates zeroed bytes without treating the storage-only uint8 as a value type.
Arguments Name Type Description countinteger
Returns Type Description array . Bytes
Raises Type Condition string when count is not a nonnegative integer
array.newArrayfunction
Allocates zeroed storage with the struct witness's physical layout.
Type parameters
Arguments Name Type Description takes witnessT countinteger
Returns Type Description array . Array < T >
Raises Type Condition string when count is not a nonnegative integer or exceeds the target's storage limit
array.scalarfunction
Allocates zeroed storage for the selected scalar element type.
Type parameters
Arguments Name Type Description borrows witnessarray . Scalar < T > countinteger
Returns Type Description array . Array < T >
Raises Type Condition string when count is not a nonnegative integer or exceeds the target's storage limit
← Previous nupp.mem.arena Next → nupp.mem.heap