Effortlessly embed a local directory into a vfs.
vfs-shadow is a Rust crate that provides a macro,
load_into_vfs!,
which allows embedding a local directory into a virtual file system using the
vfs crate.
vfs-shadow is designed to simplify the process of preparing a virtual file
system in Rust.
Using the load_into_vfs! macro, it allows you to embed a local directory
directly into your binary at compile time.
During runtime, the files and directories are automatically written into a
virtual file system provided by the vfs crate, making them accessible as if
they were part of the file system.
This makes it easy to bundle assets or configuration files with your application
without needing to manage them separately.
By simply pointing to a directory in your project, you can include its contents
into the virtual file system, streamlining the process of setting up a file
system for your application.
In the example/example.rs file, you can see how to use the macro to embed a directory into the virtual file system:
let fs = load_into_vfs!("example/vfs", MemoryFS::new()).unwrap();This will include the example/vfs directory into the file system
and use it with the MemoryFS implementation of the vfs crate.
The version follows the format x.y.z+a.b:
x.y.zis the crate version.a.bis the version of thevfscrate.
The patch version is ignored here, as upgrading it should not cause issues.
This crate is licensed under the MIT license. See the LICENSE file for more details.