Overview of Sequential-storage
masterSequential-storage is a Rust crate designed for storing data in flash memory with minimal erase cycles. It is built on top of the embedded-storage trait and is suitable for embedded systems where flash longevity is a concern.
It provides two primary data structures:
- Map: A key-value pair store, ideal for configuration data. It supports user-defined key and value types.
- Queue: A FIFO (First-In-First-Out) store, ideal for caching byte slices in memory.
Key features include:
- Wear Leveling: Pages are used cyclically to ensure equal erase cycles across all pages.
- Power-fail Safety: The system is designed to be either fine or fully recoverable after a power failure.
- Corruption Repair: Automatically attempts to repair flash state when corruption is detected during operations.
- CRC Protection: Both item headers and item data are protected by CRCs.
Warning on Async Operations: The crate uses futures for operations. If a future is cancelled while writing to flash, it can lead to a corrupted flash state. While the crate will attempt to repair the state, the specific data you were attempting to store or erase may be lost or incomplete.