PathTreeMulti

Struct PathTreeMulti 

Source
pub struct PathTreeMulti<T> {
    pub directory: DirectoryMulti<T>,
}
Expand description

§PathTree Multi

PathTreeMulti can store multiple files <T> on the nested DirectoryMulti

The path is also used to specify the name of the file, so the target directory is the second one from the end in cases where you work with files

Fields§

§directory: DirectoryMulti<T>

Trait Implementations§

Source§

impl<T: Clone> Clone for PathTreeMulti<T>

Source§

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

Returns a duplicate 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 PathTreeMulti<T>

Source§

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

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

impl<T: Default> Default for PathTreeMulti<T>

Source§

fn default() -> PathTreeMulti<T>

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

impl<T> Into<DirectoryMulti<T>> for PathTreeMulti<T>

Source§

fn into(self) -> DirectoryMulti<T>

Converts this type into the (usually inferred) input type.
Source§

impl<T: PartialEq> PartialEq for PathTreeMulti<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PathTreeInit for PathTreeMulti<T>

Source§

fn new(name: impl Borrow<str>) -> Self

Creates a new pathtree with the given name
Source§

impl<T> PathioFileStorage<T> for PathTreeMulti<T>

Source§

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

Adds file directly to this directory
Source§

fn insert_file( &mut self, path: impl Borrow<str>, file: T, ) -> 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 PathTreeMulti<T>

Source§

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

Adds subdirectory directly to this directory, returns new subdirectories’ name
Source§

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

Inserts subdirectory to self or any subdirectory, returns inserted subdirectories’ name
Source§

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

Creates subdirectory in root or any subdirectory, returns new subdirectories’ name
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 crawl(&self) -> Vec<&DirectoryMulti<T>>

Recursively iterate over all containing directories and their subdirectories and return them in one vector
Source§

fn tree(&self) -> String

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

fn tree_dir(&self) -> String

Generate overview of the directories inside 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 PathTreeMulti<T>

Auto Trait Implementations§

§

impl<T> Freeze for PathTreeMulti<T>

§

impl<T> RefUnwindSafe for PathTreeMulti<T>
where T: RefUnwindSafe,

§

impl<T> Send for PathTreeMulti<T>
where T: Send,

§

impl<T> Sync for PathTreeMulti<T>
where T: Sync,

§

impl<T> Unpin for PathTreeMulti<T>
where T: Unpin,

§

impl<T> UnwindSafe for PathTreeMulti<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.