Skip to main content

Module persistence

Module persistence 

Source
Expand description

Key-value persistence: in-memory stores synced to the file system, browser storage or kept memory-only depending on the environment. Key-value persistence.

A Store is a typed in-memory map that syncs its content to an optional Storage: an embedded Turso database (feature persistence) on a file system natively and on OPFS in the browser, or nothing at all. CacheOption decides whether the whole namespace is ingested at open or entries are faulted in one key at a time.

Every cache is identified by a Namespace, a /-separated string such as autotune/0.11.0/cuda-0/matmul. All the namespaces of an environment share one database file and are told apart by a column rather than by a directory tree. Entries are therefore looked up per key, several processes can share a root safely through WAL, and shipping a subset of them is a query away (see crate::bundle).

Re-exports§

pub use storage::*;

Modules§

storage
The writable half of persistence: where a namespace’s entries live.

Structs§

Namespace
Where a Store’s entries live inside an environment: a /-separated location such as autotune/0.11.0/cuda-0/matmul.
Store
A typed key-value store over an optional persistence Storage: a Turso database on native targets and in the browser (feature persistence), or nothing at all.
StoreOptions
Defines how to create a Store.

Enums§

CacheConfig
Cache location options.
CacheOption
How a Store populates its in-memory map from its storage.
StoreError
Error related to a Store.

Traits§

StoreKey
Trait to be implemented for store keys.
StoreValue
Trait to be implemented for store values.