Skip to main content

Store

Trait Store 

Source
pub trait Store {
    // Required methods
    fn load(&self, key: &str) -> Option<String>;
    fn save(&self, key: &str, val: &str);
}
Expand description

A minimal key→string blob store. Keys are short, filesystem-safe slugs.

Required Methods§

Source

fn load(&self, key: &str) -> Option<String>

Load a previously-saved value, or None if absent/unreadable.

Source

fn save(&self, key: &str, val: &str)

Persist a value under key, overwriting any prior value. Best-effort: a failure is swallowed (persistence is a convenience, not correctness).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§