Atom

binary.fixed()

Defines an inline fixed-length sequence.

Signature

binary.fixed(element, count)

Parameters

Packable descriptor/layout and positive signed count.

Returns

Layout value.

Behavior

Element stride comes from the element layout. Inline storage cannot resize.

Errors

Invalid layout, count or size overflow.

Example

Atom
use binary
record = create({color = binary.fixed(u8, 4)})
record.color[3] = 255
assert(count(record.color) == 4)