vox-bounded-fs API Reference (generated)
vox-bounded-fs
Section titled “vox-bounded-fs”Crate: vox-bounded-fs · Version: 0.6.0 · Target: Library (lib.rs)
Sandboxed, bounded filesystem operations from the Vox project.
Crate Overview
Section titled “Crate Overview”UTF-8 file reads capped by [vox_scaling_policy::ScalingPolicy::embedded] max_file_bytes_hint.
This crate is the workspace SSOT for scaling-policy-aware capped reads used by CI, MCP,
publisher, Populi, and other crates. Prefer it over per-crate copies of bounded_fs.
Features
Section titled “Features”| Feature | Default / Enables |
|---|---|
async | dep:tokio |
default | — |
Workspace Dependencies
Section titled “Workspace Dependencies”| Dependency | Kind |
|---|---|
vox-scaling-policy | Normal |
Public API Surface
Section titled “Public API Surface”Functions
Section titled “Functions”| Function | Description |
|---|---|
max_file_bytes_hint | Current cap from embedded scaling policy. |
read_utf8_path_capped | Read a file as UTF-8; errors if size exceeds [max_file_bytes_hint] or bytes are not valid UTF-8. |
normalize_text | Normalize source/text bytes for cross-platform consistency: strip one leading UTF-8 BOM and convert CRLF/CR line endings to LF. Pure, idempotent, and allocation-light (returns input unchanged when already clean). Shared by the compiler lexer and the runtime text-read functions. |
read_utf8_path_capped_or_empty | Same as [read_utf8_path_capped] but returns an empty string on any failure. |
read_utf8_path_capped_opt | Same as [read_utf8_path_capped] but returns None on any failure. |
read_utf8_path_capped_async | Capped read on the blocking pool (for async call sites; avoids unbounded tokio::fs::read_to_string). |