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 SQLite database on std targets, browser storage on wasm (feature browser-cache), 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. On std targets all the namespaces of a cache root share one database file (cubecl.db) 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: an embedded database on native targets, browser storage on wasm (feature browser-cache), 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.