Expand description
Pluggable file source for Lua’s fs.read / fs.read_bytes.
Consumers (e.g. embedded-app binaries) implement FileSource to
redirect the runtime’s filesystem reads through their own backing
store — typically a rust-embed virtual FS plus optional disk
overlays for operator config.
When no FileSource is registered, fs.read falls back to direct
disk reads (preserving the standalone assay run script.lua
behaviour).
Structs§
- Disk
File Source - Default FileSource that reads directly from disk. Available for callers who want to register a source explicitly but keep disk-backed semantics.
Traits§
- File
Source - Anything that can resolve a path string to bytes. Implementations
MUST be cheap to clone (we hold
Arc<dyn FileSource>) andSend + Syncso they can live in mlua’s app-data across async tasks.
Functions§
- set_
file_ source - Register a
FileSourcewith the given Lua state. Subsequent calls tofs.read/fs.read_bytesconsult this source instead of reading from disk directly.