Expand description
Persistence abstraction for HIVE documents
This module provides traits for persisting HIVE mesh state across restarts. Platform implementations can use platform-specific storage backends:
- ESP32: NVS (Non-Volatile Storage)
- iOS/macOS: Keychain or UserDefaults
- Android: SharedPreferences or EncryptedSharedPreferences
- Linux: File-based or SQLite
§Usage
use hive_btle::persistence::{DocumentStore, MemoryStore};
use hive_btle::document::HiveDocument;
use hive_btle::NodeId;
// Use the in-memory store for testing
let mut store = MemoryStore::new();
// Save a document
let doc = HiveDocument::new(NodeId::new(0x12345678));
store.save(&doc).unwrap();
// Load it back
let loaded = store.load().unwrap();
assert!(loaded.is_some());Structs§
- File
Store - File-based document store
- Memory
Store - In-memory document store for testing
- Shared
Store - Wrapper to make a DocumentStore shareable across threads
Traits§
- Document
Store - Trait for persisting HIVE documents