Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

World drawing: assets

cinnabar:world-draw/assets@0.1.0

Reads only immutable package files verified by the host, without filesystem access.

Grants: world_draw; only this component’s verified package files are readable.

Imported type draw-error: draw-error.

Types

Functions

read

read: func(path: string) -> result<list<u8>, draw-error>;

A missing or unowned file is refused. Reads share the callback’s byte budget.

Types: draw-error.

length

length: func(path: string) -> result<u64, draw-error>;

Returns the verified file length without copying it into guest memory.

Types: draw-error.

read-range

read-range: func(path: string, offset: u64, length: u32) -> result<list<u8>, draw-error>;

Streams an asset across callbacks within the same per-callback byte allowance.

Types: draw-error.