Skip to main content

Crate structfs_ll_store

Crate structfs_ll_store 

Source
Expand description

LLStructFS: Low-Level StructFS Store Traits

This is the narrow waist of the StructFS stack. Everything at this level is pure bytes - no path validation, no value semantics, no format interpretation.

Use this layer for:

  • WASM/FFI boundaries where you’re marshalling raw memory
  • Wire protocols where you’re moving bytes without inspection
  • Zero-copy forwarding proxies
  • Any transport that shouldn’t pay parsing costs

§Example

use structfs_ll_store::{LLReader, LLWriter, LLError};
use bytes::Bytes;

struct InMemoryLLStore {
    data: std::collections::HashMap<Vec<Vec<u8>>, Bytes>,
}

impl LLReader for InMemoryLLStore {
    fn ll_read(&mut self, path: &[&[u8]]) -> Result<Option<Bytes>, LLError> {
        let key: Vec<Vec<u8>> = path.iter().map(|c| c.to_vec()).collect();
        Ok(self.data.get(&key).cloned())
    }
}

§Async Support

Enable the async feature for async trait variants:

[dependencies]
structfs-ll-store = { version = "0.1", features = ["async"] }

Then use AsyncLLReader, AsyncLLWriter, and AsyncLLStore.

Structs§

Bytes
A cheaply cloneable and sliceable chunk of contiguous memory.
LLPath
An owned path at the LL level: a sequence of opaque byte components.

Enums§

LLError
Errors at the LL (low-level) layer.

Traits§

LLReader
Read bytes from a path.
LLStore
Combined read/write at the LL level.
LLWriter
Write bytes to a path.

Functions§

ll_path
Convenience function to create an owned path from byte slices.
ll_path_from_strs
Convenience function to create an owned path from string slices.