Skip to main content

Module session_kv

Module session_kv 

Source
Expand description

Session-scoped key-value store: the trait an embedder implements and a bounded in-memory implementation.

Keys and payloads are UTF-16 code units end to end. A payload can contain lone surrogates — a value a Submilli string may legally hold — so nothing here round-trips through a Rust String, which would replace them.

The store outlives the Wasm store it is read from, so it never retains guest GC references: serialization to code units happens above this layer.

Structs§

InMemorySessionKv
Bounded in-memory store.
SessionKvEntry
Key plus retained payload size — what list may disclose. Never contents.
SessionKvLimits
SessionKvPage
One page of a key scan.
SharedKvBudget
An aggregate byte budget several sessions reserve against.

Enums§

SessionKvError
SessionKvLimitKind
Which bound a rejected operation ran into. Carries the numbers, never the value — an error message about a quota must not leak session contents.

Constants§

DEFAULT_MAX_ENTRIES
DEFAULT_MAX_KEY_UNITS
UTF-16 code units in a nonempty key.
DEFAULT_MAX_SESSION_BYTES
Retained serialized payload per session.
DEFAULT_MAX_VALUE_BYTES
Serialized payload of a single value.

Traits§

SessionKvStore
Session-scoped key-value storage.