store.get()
读取一个键的当前字节值和乐观并发版本。键不存在时返回 null。
Syntax
const entry = await host.store.get(key);
Return value
{ value: Bytes, version: u64 } | null
Examples
const entry = await host.store.get('settings/theme');
const theme = entry ? new TextDecoder().decode(entry.value) : 'system';
Errors
invalid-key、sink-too-small(原生绑定)、limit-exceeded。不存在不是错误。
Requirements
- 能力:
host:store.get - 用户激活:不需要
- 信任档位:green