viewBufferAsStruct<S extends Struct> method

S? viewBufferAsStruct<S extends Struct>(
  1. TypedDataCaster<S> caster
)

view as ffi.Struct must be on full length or Struct.create will throw view as full length, including invalid data. a buffer backing larger than all potential calls is expected to be allocated at initialization

Implementation

S? viewBufferAsStruct<S extends Struct>(TypedDataCaster<S> caster) => caster(bufferAsBytes);