Skip to main content

Module mem_environment_store

Module mem_environment_store 

Source
Expand description

§In-memory EnvironmentStore for tests

Volatile implementation of crate::environment::environment_store::EnvironmentStore backed by a HashMap for bundles/metadata and a BTreeMap for feedback (so range queries over composite (location, post, feedback_type) keys work identically to the disk store).

One subtlety: the decimation path needs to hold a write lock while also iterating the bundle set, and Rust’s borrow rules don’t allow that directly. The module uses an ouroboros self-referential struct to safely carry the guard alongside the iterator, matching what the disk store gets from its fjall cursor.

Structs§

LockedPostBundleIter
The self-referencing struct.
MemEnvironmentFactory
MemEnvironmentStore
MemEnvironmentStore implements the EnvironmentStore trait for use during testing. Everything is stored in memory and is volatile to restarts.