Expand description
Chunked, #![no_std] virtual file system on Embassy ekv.
Large files are split into fixed-size chunks in the key-value store so you can
stream reads with bounded RAM. Paths are opaque strings (e.g. /photos/cat.jpg);
there is no directory listing API.
§Example
ⓘ
use ekv::{Config, Database};
use ekv_fs::EkvFs;
// After formatting flash and opening your `Database`:
let fs = EkvFs::<_, _, 64, 512>::new(&db);
fs.write_file("/hello.txt", b"Hello").await?;
let meta = fs.stat("/hello.txt").await?;
let mut file = fs.open("/hello.txt").await?;
let mut buf = [0u8; 32];
let n = file.read(&mut buf).await?;Structs§
- EkvFile
- Handle for sequential, chunk-cached reads of one file.
- EkvFs
- Chunked virtual file system backed by an
ekv::Database. - File
Meta - Serialized metadata stored under the
m:{path}key.
Enums§
- Error
- Errors that can occur when using the virtual file system.
Constants§
- KEY_
BUF_ CAP - Stack buffer capacity for formatted
ekvkeys. - KEY_
SUFFIX_ OVERHEAD - Extra bytes beyond
MAX_PATH_LENfor the longest key (c:{path}:{index}).
Functions§
- max_
key_ len - Key buffer capacity derived from
MAX_PATH_LEN. - path_
fits - Returns
trueifpathfits inMAX_PATH_LENbytes.