StorageBuffer
인터페이스, 레이아웃 분류
The handle storageBuffer returns: a bound runtime-length array<Element> storage buffer.
import type { StorageBuffer } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
interface StorageBuffer<A> { readonly binding: BindingDecl; readonly node: Node; readonly elementDecl?: StructDecl; at(i: ReadonlyNode<ScalarKey> | number): A;}설명
.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.
인스턴스 속성
binding읽기 전용BindingDeclThe binding declaration, for
module({ bindings }).node읽기 전용NodeThe raw binding access node for the whole array.
elementDecl선택 사항읽기 전용StructDeclThe element struct’s declaration, when the element was a struct handle, so that
module({ uses: [buf] })registers the element struct too.
인스턴스 메서드
at(i: ReadonlyNode<ScalarKey> | number): ARead element
i: the typed field proxy for a struct element, the element node for a scalar or vector element.
함께 보기
소스
src/core/sot.ts, 1005행, 커밋 c66579bf 기준