Module key_value

Source
Expand description

Key/Value storage. Spin key-value persistent storage

This module provides a generic interface for key-value storage, which may be implemented by the host various ways (e.g. via an in-memory table, a local file, or a remote database). Details such as consistency model and durability will depend on the implementation and may vary from one to store to the next.

§Examples

Open the default store and set the ‘message’ key:

let store = spin_sdk::key_value::Store::open_default()?;
store.set("message", "Hello world".as_bytes())?;

Structs§

Store
An open key-value store.

Enums§

Error
The set of errors which may be raised by functions in this interface