CstorageProviderinterface
interface CstorageProvider ...
A coherent family of physical storage operations.
representation is native, the only family Nupp compiles for, and the facade checks it before publishing this table: a provider built for some other layout cannot be selected into a program whose layout is already compiled.
Allocation, descriptors, scalar codecs, and copies must agree on byte order, alignment, width, and pointer units. Decode inputs contain at least the scalar width in bytes. Borrowed views preserve source lifetimes; borrows, generic casts, and const views are part of the implementation contract. Opaque values in these signatures carry provider storage, not permission to change a compiled representation at runtime.
Members
| Name | Kind | Description |
|---|
priority | field | |
boundedCount | method | Returns the requested count after any representation-specific extent check. |
representation | field | The storage family this table implements, which must be native. |
structs | field | Struct descriptors and row operations sharing this storage family. |
layout | field | Returns target layout facts for a type or descriptor, where the family reports them. |
scalar | method | Returns the canonical descriptor for a scalar kind within this provider. |
descriptor | method | Reports layout and bounds for a provider value. |
reference | field | Creates a deferred descriptor reference for recursive layouts. |
allocateArray | method | Allocates count elements of the supplied descriptor. |
allocateBytes | method | Allocates a writable byte region containing count bytes. |
borrowString | method | Returns a read-only byte view whose lifetime borrows the source string. |
castBytes | method | Returns a read-only byte view borrowing the pointer owner. |
castElements | field | Interprets a pointer using any supplied element ctype. |
copy | method | Copies count bytes into destination without replacing its owner. |
fill | method | Fills count bytes in destination with the given byte value. |
sizeOf | method | Returns the descriptor size in bytes. |
string | method | Copies count source bytes into an independent Lua string. |
decodeUint8 | method | Decodes a unsigned 8-bit integer using the target storage byte order. |
encodeUint8 | method | Encodes a unsigned 8-bit integer using the target storage byte order. |
decodeInt8 | method | Decodes a signed 8-bit integer using the target storage byte order. |
encodeInt8 | method | Encodes a signed 8-bit integer using the target storage byte order. |
decodeUint16 | method | Decodes a unsigned 16-bit integer using the target storage byte order. |
encodeUint16 | method | Encodes a unsigned 16-bit integer using the target storage byte order. |
decodeInt16 | method | Decodes a signed 16-bit integer using the target storage byte order. |
encodeInt16 | method | Encodes a signed 16-bit integer using the target storage byte order. |
decodeUint32 | method | Decodes a unsigned 32-bit integer using the target storage byte order. |
encodeUint32 | method | Encodes a unsigned 32-bit integer using the target storage byte order. |
decodeInt32 | method | Decodes a signed 32-bit integer using the target storage byte order. |
encodeInt32 | method | Encodes a signed 32-bit integer using the target storage byte order. |
decodeUint64 | method | Decodes a unsigned 64-bit integer using the target storage byte order. |
encodeUint64 | method | Encodes a unsigned 64-bit integer using the target storage byte order. |
decodeInt64 | method | Decodes a signed 64-bit integer using the target storage byte order. |
encodeInt64 | method | Encodes a signed 64-bit integer using the target storage byte order. |
decodeFloat32 | method | Decodes an IEEE-754 binary32 value using the target storage byte order. |
encodeFloat32 | method | Encodes an IEEE-754 binary32 value using the target storage byte order. |
decodeFloat64 | method | Decodes an IEEE-754 binary64 value using the target storage byte order. |
encodeFloat64 | method | Encodes an IEEE-754 binary64 value using the target storage byte order. |
boundedCountmethod
boundedCount: function(borrows source: any, count: integer): integer
@readonly
Returns the requested count after any representation-specific extent check. Callers remain responsible for valid native pointer extents.
Arguments
| Name | Type | Description |
|---|
borrows source | any | |
count | integer | |
Returns
representationfield
@readonly
The storage family this table implements, which must be native.
structsfield
@readonly
Struct descriptors and row operations sharing this storage family.
layoutfield
layout: (function(subject: any): any)?
@readonly
Returns target layout facts for a type or descriptor, where the family reports them.
scalarmethod
scalar: function(kind: string): any
@readonly
Returns the canonical descriptor for a scalar kind within this provider.
Arguments
| Name | Type | Description |
|---|
kind | string | |
Returns
descriptormethod
descriptor: function(value: any): any
@readonly
Reports layout and bounds for a provider value.
Arguments
| Name | Type | Description |
|---|
value | any | |
Returns
referencefield
reference: (function(resolve: function(): any): any)?
@readonly
Creates a deferred descriptor reference for recursive layouts.
allocateArraymethod
allocateArray: function(element: any, count: integer): any
@readonly
Allocates count elements of the supplied descriptor.
Arguments
| Name | Type | Description |
|---|
element | any | |
count | integer | |
Returns
allocateBytesmethod
allocateBytes: function(count: integer): uint8[?]
@readonly
Allocates a writable byte region containing count bytes.
Arguments
| Name | Type | Description |
|---|
count | integer | |
Returns
borrowStringmethod
borrowString: function(borrows bytes: string): const uint8[?] borrows (bytes)
@readonly
Returns a read-only byte view whose lifetime borrows the source string.
Arguments
| Name | Type | Description |
|---|
borrows bytes | string | |
Returns
| Type | Description |
|---|
const uint8[?] borrows (bytes) | |
castBytesmethod
@readonly
Returns a read-only byte view borrowing the pointer owner.
Arguments
| Name | Type | Description |
|---|
borrows pointer | any | |
Returns
castElementsfield
@readonly
Interprets a pointer using any supplied element ctype.
copymethod
copy: function(borrows destination: any, borrows source: any, count: integer): nil
@readonly
Copies count bytes into destination without replacing its owner.
Arguments
| Name | Type | Description |
|---|
borrows destination | any | |
borrows source | any | |
count | integer | |
Returns
fillmethod
fill: function(destination: any, count: integer, value: integer): nil
@readonly
Fills count bytes in destination with the given byte value.
Arguments
| Name | Type | Description |
|---|
destination | any | |
count | integer | |
value | integer | |
Returns
sizeOfmethod
sizeOf: function(element: any): integer
@readonly
Returns the descriptor size in bytes.
Arguments
| Name | Type | Description |
|---|
element | any | |
Returns
stringmethod
string: function(borrows source: any, count: integer): string
@readonly
Copies count source bytes into an independent Lua string.
Arguments
| Name | Type | Description |
|---|
borrows source | any | |
count | integer | |
Returns
decodeUint8method
decodeUint8: function(bytes: string): uint32
@readonly
Decodes a unsigned 8-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeUint8method
@readonly
Encodes a unsigned 8-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | uint32 | |
Returns
decodeInt8method
decodeInt8: function(bytes: string): int32
@readonly
Decodes a signed 8-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeInt8method
@readonly
Encodes a signed 8-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | int32 | |
Returns
decodeUint16method
decodeUint16: function(bytes: string): uint32
@readonly
Decodes a unsigned 16-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeUint16method
@readonly
Encodes a unsigned 16-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | uint32 | |
Returns
decodeInt16method
decodeInt16: function(bytes: string): int32
@readonly
Decodes a signed 16-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeInt16method
@readonly
Encodes a signed 16-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | int32 | |
Returns
decodeUint32method
decodeUint32: function(bytes: string): uint32
@readonly
Decodes a unsigned 32-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeUint32method
@readonly
Encodes a unsigned 32-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | uint32 | |
Returns
decodeInt32method
decodeInt32: function(bytes: string): int32
@readonly
Decodes a signed 32-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeInt32method
@readonly
Encodes a signed 32-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | int32 | |
Returns
decodeUint64method
decodeUint64: function(bytes: string): uint64
@readonly
Decodes a unsigned 64-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeUint64method
@readonly
Encodes a unsigned 64-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | uint64 | |
Returns
decodeInt64method
decodeInt64: function(bytes: string): int64
@readonly
Decodes a signed 64-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeInt64method
@readonly
Encodes a signed 64-bit integer using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | int64 | |
Returns
decodeFloat32method
decodeFloat32: function(bytes: string): float
@readonly
Decodes an IEEE-754 binary32 value using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeFloat32method
encodeFloat32: function(value: number): string
@readonly
Encodes an IEEE-754 binary32 value using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | number | |
Returns
decodeFloat64method
decodeFloat64: function(bytes: string): number
@readonly
Decodes an IEEE-754 binary64 value using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
bytes | string | |
Returns
encodeFloat64method
encodeFloat64: function(value: number): string
@readonly
Encodes an IEEE-754 binary64 value using the target storage byte order.
Arguments
| Name | Type | Description |
|---|
value | number | |
Returns
StructvalueProviderinterface
interface StructvalueProvider ...
Struct-value operations supplied as part of the storage family.
Descriptors, arrays, and constructed values must agree with compiler layouts and canonical struct declarations. referenceValued reports whether a row reference addresses the underlying storage. The storage implementation supplies compatible struct operations as part of the same family.
Members
| Name | Kind | Description |
|---|
scalar | method | Returns a scalar descriptor accepted by define and array. |
array | method | Allocates count elements using this family's element descriptor. |
define | method | Constructs a type descriptor from a compiler layout and method table. |
referenceValued | field | Whether row references address their underlying storage. |
scalarmethod
scalar: function(kind: string): any
@readonly
Returns a scalar descriptor accepted by define and array.
Arguments
| Name | Type | Description |
|---|
kind | string | |
Returns
arraymethod
array: function(element: any, count: integer): any
@readonly
Allocates count elements using this family's element descriptor.
Arguments
| Name | Type | Description |
|---|
element | any | |
count | integer | |
Returns
definemethod
@readonly
Constructs a type descriptor from a compiler layout and method table.
Arguments
| Name | Type | Description |
|---|
layout | any | |
methods | table | |
Returns
referenceValuedfield
@readonly
Whether row references address their underlying storage.