PixieKV is a lightweight, no_std compatible key-value store written in Rust. It is designed to be a simple and efficient storage solution for embedded systems and other resource-constrained environments.
- Set and get values
- Delete values
- Save and load from file
- No_std compatible
- Persistent storage using LittleFS
- Generic value types (supports any type that implements Serialize and Deserialize)
- Fixed-size storage with compile-time checks
- Database integrity validation using CRC32 hashing
PixieKV is implemented using a heapless::FnvIndexMap as the underlying data structure. This allows for efficient lookups and inserts while maintaining a fixed-size storage that's suitable for embedded systems.
The key-value store is designed to be simple, efficient, and easy to use in no_std environments. It uses the LittleFS file system for persistent storage, allowing data to be saved and loaded from flash memory or other storage mediums.
use pixiekv::PixieKV;
let mut store = PixieKV::default();
store.insert("key", "value");
let value = store.get("key");
store.remove("key");
store.save_to_file("database.db");
let loaded_store = PixieKV::load_from_file("database.db");For running emulated tests on ARM Cortex-M targets, you need to install QEMU:
sudo apt update
sudo apt install qemu-system-armUsing Homebrew:
brew install qemuUsing MacPorts:
sudo port install qemu- Download QEMU from the official website: https://www.qemu.org/download/#windows
- Run the installer and follow the installation wizard
- Add QEMU to your system PATH:
- Open "Environment Variables" in System Properties
- Add the QEMU installation directory (usually
C:\Program Files\qemu) to the PATH variable
Alternatively, using Chocolatey:
choco install qemuOr using Scoop:
scoop install qemuInstall the ARM cross-compilation toolchain:
sudo apt update
sudo apt install gcc-arm-none-eabiUsing Homebrew:
brew install arm-none-eabi-gcc- Download ARM GNU Toolchain from: https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
- Install the "arm-none-eabi" variant for your Windows version
- Add the toolchain
bindirectory to your system PATH (usuallyC:\Program Files (x86)\Arm GNU Toolchain arm-none-eabi\<version>\bin)
Alternatively, using Chocolatey:
choco install gcc-arm-embeddedInstall the ARM Cortex-M target for Rust:
rustup target add thumbv7m-none-eabicargo testcargo run --example std_examplecargo run --target thumbv7m-none-eabi --releaseMIT