StorageBuffer
On this page

StorageBuffer

Interface in Layout

The handle storageBuffer returns: a bound runtime-length array<Element> storage buffer.

import type { StorageBuffer } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

interface StorageBuffer<A> {
readonly binding: BindingDecl;
readonly node: Node;
readonly elementDecl?: StructDecl;
at(i: ReadonlyNode<ScalarKey> | number): A;
}

Description

.at(i) is the element accessor. For a struct element (a structDecl or ioStruct handle) it returns the typed field proxy, buf.at(i).p0, with no .of() and no element-type argument; for a scalar element (f32T) it returns the element node.

Instance properties

bindingread only BindingDecl

The binding declaration, for module({ bindings }).

noderead only Node

The raw binding access node for the whole array.

elementDecloptionalread only StructDecl

The element struct’s declaration, when the element was a struct handle, so that module({ uses: [buf] }) registers the element struct too.

Instance methods

at (i: ReadonlyNode<ScalarKey> | number): A

Read element i: the typed field proxy for a struct element, the element node for a scalar or vector element.

See also

Source

src/core/sot.ts, line 1005, at commit 26de7be8

Edit this page Report a problem