ekv_fs/lib.rs
1//! Chunked, `#![no_std]` virtual file system on [Embassy `ekv`](https://github.com/embassy-rs/ekv).
2//!
3//! Large files are split into fixed-size chunks in the key-value store so you can
4//! stream reads with bounded RAM. Paths are opaque strings (e.g. `/photos/cat.jpg`);
5//! there is no directory listing API.
6//!
7//! # Example
8//!
9//! ```ignore
10//! use ekv::{Config, Database};
11//! use ekv_fs::EkvFs;
12//!
13//! // After formatting flash and opening your `Database`:
14//! let fs = EkvFs::<_, _, 64, 512>::new(&db);
15//! fs.write_file("/hello.txt", b"Hello").await?;
16//! let meta = fs.stat("/hello.txt").await?;
17//! let mut file = fs.open("/hello.txt").await?;
18//! let mut buf = [0u8; 32];
19//! let n = file.read(&mut buf).await?;
20//! ```
21
22#![no_std]
23#![deny(missing_docs)]
24
25#[cfg(test)]
26extern crate alloc;
27
28mod error;
29mod file;
30mod fs;
31mod key;
32mod meta;
33
34pub use error::Error;
35pub use file::EkvFile;
36pub use fs::EkvFs;
37pub use key::{KEY_BUF_CAP, KEY_SUFFIX_OVERHEAD, max_key_len, path_fits};
38pub use meta::FileMeta;
39
40#[cfg(test)]
41mod tests;