Crates.io | vfs-tools |
lib.rs | vfs-tools |
version | 0.1.0 |
source | src |
created_at | 2023-05-19 14:48:19.912333 |
updated_at | 2023-05-19 14:48:19.912333 |
description | A collection ofttools to work with VFS |
homepage | https://gitlab.com/johlrogge.rs/crates/vfs-tools |
repository | https://gitlab.com/johlrogge.rs/crates/vfs-tools |
max_upload_size | |
id | 868908 |
size | 8,126 |
A crate with a few tools to make the use of vfs a bit more convenient.
[setup_files] is a macro for preparing a MemoryFS with contents. This macro is intended for testing.
use vfs_tools::setup_files;
let root_path = setup_files! {
some/path/"file1": b"contents of file1"
some/path/"file2": b"contents of file2"
some/other/path/"file3": b"contents of file3"
}?;
let mut result = String::new();
root_path.join("some/path/file2")?.open_file()?.read_to_string(&mut result)?;
assert_eq!("contents of file2", result);
# Ok::<(),::vfs::error::VfsError>(())
[VfsPathExt] contains extensions to [vfs::VfsPath]