Expand description
Storage backends and abstractions.
This module provides the storage layer abstraction for Nitrite. The storage system is pluggable, allowing different implementations (in-memory, file-based, etc.).
§Storage Providers
Storage providers implement NitriteStoreProvider and are loaded as plugins.
Nitrite includes:
- In-Memory Store:
InMemoryStoreModulefor testing and temporary data - Fjall Store:
nitrite-fjall-adapterfor persistent, LSM-based storage
§Key-Value Abstraction
The storage layer provides a key-value map interface through NitriteMapProvider.
Maps support:
- Basic operations: get, put, remove
- Iteration: keys, values, entries
- Metadata: size, attributes
§Persistence
Storage is abstracted behind the NitriteStoreProvider trait, allowing:
- Multiple store implementations
- Custom storage backends
- Testing with in-memory stores
§Events
The store layer supports event listeners for monitoring store state changes, useful for debugging and metrics collection.
Modules§
Structs§
- Entry
Iterator - A unified facade for bidirectional iteration over (Key, Value) entries.
- KeyIterator
- A unified facade for bidirectional iteration over keys.
- Nitrite
Map - Nitrite
Store - High-level wrapper for accessing a Nitrite database store.
- Single
MapEntry Provider - Built-in provider for iterating entries from a single NitriteMap.
- Single
MapKey Provider - Built-in provider for iterating keys from a single NitriteMap.
- Single
MapValue Provider - Built-in provider for iterating values from a single NitriteMap.
- Store
Catalog - Manages the catalog of collections, repositories, and keyed repositories in a Nitrite store.
- Store
Catalog Inner - Store
Config - Store
Event Info - Context information provided with each store event.
- Store
Event Listener - A listener for store-level events that wraps a callback function.
- Value
Iterator - A unified facade for bidirectional iteration over values.
Enums§
- Store
Events - Enumeration of lifecycle events that occur at the store level.
Traits§
- Entry
Iterator Provider - Trait for implementing entry iteration over (Key, Value) pairs.
- KeyIterator
Provider - Trait for implementing key iteration.
- Metadata
- Nitrite
MapProvider - Low-level interface for key-value store implementations in Nitrite.
- Nitrite
Store Provider - Low-level interface for managing a Nitrite database store.
- Store
Config Provider - Store
Event Callback - A trait for closures that handle store events.
- Store
Module - Value
Iterator Provider - Trait for implementing value iteration.
Type Aliases§
- Nitrite
MapEntry Iterator - Type alias for
EntryIteratorfor backward compatibility. - Nitrite
MapKey Iterator - Type alias for
KeyIteratorfor backward compatibility. - Nitrite
MapValue Iterator - Type alias for
ValueIteratorfor backward compatibility.