Crates.io | pathio |
lib.rs | pathio |
version | 0.2.3 |
source | src |
created_at | 2023-09-19 20:14:07.842005 |
updated_at | 2023-11-17 10:54:37.695243 |
description | Data type for storing generic data on a virtual path tree hierarchy. The data is stored in memory, this is not OS file system abstraction, but immitation |
homepage | |
repository | https://github.com/bytestring-net/pathio |
max_upload_size | |
id | 977187 |
size | 57,652 |
Crate adding PathTree
, a special type immitating UNIX file system for storing any generic type <T>
.
It is created by daisy chaining HashMaps. It splits data into directories, which can store <T>
or nest subdirectories.
use pathio::prelude::*;
let mut tree: PathTree<String> = PathTree::new("FileSystem");
tree.create_directory("New_Folder").unwrap();
tree.create_directory("New_Folder/Strings").unwrap();
tree.create_directory("Cool_Folder").unwrap();
tree.insert_file("New_Folder/Strings/text.txt", "Hello World!".to_string()).unwrap();
println!("{}", tree.list());
Console output:
> FileSystem
|-> Cool_Folder
|-> New_Folder
| |-> Strings
| | |-> text.txt
Any contribution submitted by you will be dual licensed as mentioned below, without any additional terms or conditions.
Released under both APACHE and MIT licenses, for the sake of compatibility with other projects. Pick one that suits you the most!