Type Alias pathio::Directory

source ·
pub type Directory<T> = DirectoryMulti<T>;
Expand description

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

Aliased Type§

struct Directory<T> {
    pub file: AHashMap<String, T, RandomState>,
    pub directory: AHashMap<String, DirectoryMulti<T>, RandomState>,
    /* private fields */
}

Fields§

§file: AHashMap<String, T, RandomState>§directory: AHashMap<String, DirectoryMulti<T>, RandomState>

Implementations§

source§

impl<T> DirectoryMulti<T>

source

pub fn new() -> Self

Create new unassigned directory

Trait Implementations§

source§

impl<T: Clone> Clone for DirectoryMulti<T>

source§

fn clone(&self) -> DirectoryMulti<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for DirectoryMulti<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default> Default for DirectoryMulti<T>

source§

fn default() -> DirectoryMulti<T>

Returns the “default value” for a type. Read more
source§

impl<T: PartialEq> PartialEq<DirectoryMulti<T>> for DirectoryMulti<T>

source§

fn eq(&self, other: &DirectoryMulti<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PathioFileStorage<T> for DirectoryMulti<T>

source§

fn add_file( &mut self, file: T, name: impl Borrow<str> ) -> Result<(), PathioError>

Adds file directly to this directory
source§

fn insert_file( &mut self, file: T, path: impl Borrow<str> ) -> Result<(), PathioError>

Inserts file to self or any subdirectory
source§

fn take_file(&mut self, name: impl Borrow<str>) -> Result<T, PathioError>

Removes file from self and returns it
source§

fn remove_file(&mut self, path: impl Borrow<str>) -> Result<T, PathioError>

Removes file from self or any subdirectory and returns it
source§

fn obtain_file(&self, name: impl Borrow<str>) -> Result<&T, PathioError>

Borrow file from self
source§

fn obtain_file_mut( &mut self, name: impl Borrow<str> ) -> Result<&mut T, PathioError>

Borrow file from self
source§

fn borrow_file(&self, path: impl Borrow<str>) -> Result<&T, PathioError>

Borrow file from self or any subdirectory
source§

fn borrow_file_mut( &mut self, path: impl Borrow<str> ) -> Result<&mut T, PathioError>

Borrow file from self or any subdirectory
source§

impl<T> PathioHierarchy<DirectoryMulti<T>> for DirectoryMulti<T>

source§

fn add_directory( &mut self, directory: DirectoryMulti<T>, name: impl Borrow<str> ) -> Result<(), PathioError>

Adds subdirectory directly to this directory
source§

fn insert_directory( &mut self, directory: DirectoryMulti<T>, path: impl Borrow<str> ) -> Result<(), PathioError>

Inserts subdirectory to self or any subdirectory
source§

fn create_directory( &mut self, path: impl Borrow<str> ) -> Result<(), PathioError>

Creates subdirectory in root or any subdirectory
source§

fn take_directory( &mut self, name: impl Borrow<str> ) -> Result<DirectoryMulti<T>, PathioError>

Removes directory from self and returns it
source§

fn remove_directory( &mut self, path: impl Borrow<str> ) -> Result<DirectoryMulti<T>, PathioError>

Removes directory from self or any subdirectory and returns it
source§

fn obtain_directory( &self, name: impl Borrow<str> ) -> Result<&DirectoryMulti<T>, PathioError>

Borrow directory from self
source§

fn obtain_directory_mut( &mut self, name: impl Borrow<str> ) -> Result<&mut DirectoryMulti<T>, PathioError>

Borrow directory from self
source§

fn borrow_directory( &self, path: impl Borrow<str> ) -> Result<&DirectoryMulti<T>, PathioError>

Borrow directory from self or any subdirectory
source§

fn borrow_directory_mut( &mut self, path: impl Borrow<str> ) -> Result<&mut DirectoryMulti<T>, PathioError>

Borrow directory from self or any subdirectory
source§

fn merge( &mut self, directory: impl Into<DirectoryMulti<T>> ) -> Result<(), PathioError>

Merges PathTree or Directory content into itself
source§

fn list(&self) -> String

Generate overview of the inner tree in a stringified form
source§

fn get_name(&self) -> &String

Returns cached name
source§

fn get_depth(&self) -> f32

Returns cached depth
source§

fn get_path(&self) -> &String

Returns cached name
source§

impl<T> StructuralPartialEq for DirectoryMulti<T>