Crate pathio

Source
Expand description

§Pathio

§

Crate adding PathTree, a special type immitating UNIX file system for storing any generic type <T>.

§=== Description ===

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

§=== Contributing ===

Any contribution submitted by you will be dual licensed as mentioned below, without any additional terms or conditions.

§=== Licensing ===

Released under both APACHE and MIT licenses, for the sake of compatibility with other projects. Pick one that suits you the most!

Modules§

prelude

Structs§

DirectoryMulti
DirectoryMulti is a special type representing directory in PathTreeMulti
DirectorySingle
DirectorySingle is a special type representing directory in PathTreeSingle
PathTreeMulti
PathTree Multi
PathTreeSingle
PathTree Single

Enums§

PathioError

Traits§

DirectoryInit
PathTreeInit
PathioFile
PathioFileStorage
PathioHierarchy

Type Aliases§

Directory
Directory is a type DirectoryMulti, which represents a directory in immitating UNIX file system for storing any generic type <T>
PathTree
PathTree is a type PathTreeMulti, which is a special type immitating UNIX file system for storing any generic type <T>