Struct pathio::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>

Implementations§

source§

impl<T> PathTreeMulti<T>

source

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

Creates a new PathTreeMulti with the given name

Trait Implementations§

source§

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

source§

fn clone(&self) -> PathTreeMulti<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 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<PathTreeMulti<T>> for PathTreeMulti<T>

source§

fn eq(&self, other: &PathTreeMulti<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 PathTreeMulti<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 PathTreeMulti<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 PathTreeMulti<T>

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more