Skip to main content

Module storage

Module storage 

Source
Expand description

The Storage trait and the in-memory reference implementation

The core never touches files or the network: every byte entering or leaving the engine goes through this trait. Native wrappers implement it over files (plugmem-host::FileStorage), the wasm bridge over host callbacks; MemStorage backs tests and ephemeral databases.

Structs§

MemScratch
In-memory Scratch: a growable buffer that “freezes” to a borrow of itself. The reference implementation — it backs tests, and because it drives the streaming path with no files it is the vehicle for the disk_first == in_memory property test. It stages in RAM, so it does not save RAM; a host Scratch over a temp file is what bounds RAM in practice.
MemStorage
In-memory Storage: two byte buffers, no failure modes.

Traits§

Scratch
An append-only staging area: build it sequentially with write, then freeze it into a readable byte view for random and sequential reads. Dropping it discards the storage.
Storage
Where snapshot and journal bytes live.