Skip to main content

Crate ekv_fs

Crate ekv_fs 

Source
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.
FileMeta
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 ekv keys.
KEY_SUFFIX_OVERHEAD
Extra bytes beyond MAX_PATH_LEN for the longest key (c:{path}:{index}).

Functions§

max_key_len
Key buffer capacity derived from MAX_PATH_LEN.
path_fits
Returns true if path fits in MAX_PATH_LEN bytes.