Struct pathio::DirectorySingle
source · pub struct DirectorySingle<T> {
pub file: Option<T>,
pub directory: AHashMap<String, DirectorySingle<T>>,
/* private fields */
}Expand description
DirectorySingle is a special type representing directory in PathTreeSingle
Fields§
§file: Option<T>§directory: AHashMap<String, DirectorySingle<T>>Implementations§
source§impl<T> DirectorySingle<T>
impl<T> DirectorySingle<T>
Trait Implementations§
source§impl<T: Clone> Clone for DirectorySingle<T>
impl<T: Clone> Clone for DirectorySingle<T>
source§fn clone(&self) -> DirectorySingle<T>
fn clone(&self) -> DirectorySingle<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<T: Debug> Debug for DirectorySingle<T>
impl<T: Debug> Debug for DirectorySingle<T>
source§impl<T: Default> Default for DirectorySingle<T>
impl<T: Default> Default for DirectorySingle<T>
source§fn default() -> DirectorySingle<T>
fn default() -> DirectorySingle<T>
Returns the “default value” for a type. Read more
source§impl<T> Into<DirectorySingle<T>> for PathTreeSingle<T>
impl<T> Into<DirectorySingle<T>> for PathTreeSingle<T>
source§fn into(self) -> DirectorySingle<T>
fn into(self) -> DirectorySingle<T>
Converts this type into the (usually inferred) input type.
source§impl<T: PartialEq> PartialEq<DirectorySingle<T>> for DirectorySingle<T>
impl<T: PartialEq> PartialEq<DirectorySingle<T>> for DirectorySingle<T>
source§fn eq(&self, other: &DirectorySingle<T>) -> bool
fn eq(&self, other: &DirectorySingle<T>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<T> PathioFile<T> for DirectorySingle<T>
impl<T> PathioFile<T> for DirectorySingle<T>
source§fn add_file(&mut self, file: T) -> Option<T>
fn add_file(&mut self, file: T) -> Option<T>
Adds file directly to this directory and return existing one
source§fn insert_file(
&mut self,
file: T,
path: impl Borrow<str>
) -> Result<Option<T>, PathioError>
fn insert_file( &mut self, file: T, path: impl Borrow<str> ) -> Result<Option<T>, PathioError>
Inserts file to self or any subdirectory and return existing one
source§fn remove_file(
&mut self,
path: impl Borrow<str>
) -> Result<Option<T>, PathioError>
fn remove_file( &mut self, path: impl Borrow<str> ) -> Result<Option<T>, PathioError>
Removes file from self or any subdirectory and returns it
source§fn obtain_file(&self) -> Option<&T>
fn obtain_file(&self) -> Option<&T>
Borrow file from self
source§fn obtain_file_mut(&mut self) -> Option<&mut T>
fn obtain_file_mut(&mut self) -> Option<&mut T>
Borrow file from self
source§fn borrow_file(&self, path: impl Borrow<str>) -> Result<Option<&T>, PathioError>
fn borrow_file(&self, path: impl Borrow<str>) -> Result<Option<&T>, PathioError>
Borrow file from self or any subdirectory
source§fn borrow_file_mut(
&mut self,
path: impl Borrow<str>
) -> Result<Option<&mut T>, PathioError>
fn borrow_file_mut( &mut self, path: impl Borrow<str> ) -> Result<Option<&mut T>, PathioError>
Borrow file from self or any subdirectory
source§impl<T> PathioHierarchy<DirectorySingle<T>> for DirectorySingle<T>
impl<T> PathioHierarchy<DirectorySingle<T>> for DirectorySingle<T>
source§fn add_directory(
&mut self,
directory: DirectorySingle<T>,
name: impl Borrow<str>
) -> Result<(), PathioError>
fn add_directory( &mut self, directory: DirectorySingle<T>, name: impl Borrow<str> ) -> Result<(), PathioError>
Adds subdirectory directly to this directory
source§fn insert_directory(
&mut self,
directory: DirectorySingle<T>,
path: impl Borrow<str>
) -> Result<(), PathioError>
fn insert_directory( &mut self, directory: DirectorySingle<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>
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<DirectorySingle<T>, PathioError>
fn take_directory( &mut self, name: impl Borrow<str> ) -> Result<DirectorySingle<T>, PathioError>
Removes directory from self and returns it
source§fn remove_directory(
&mut self,
path: impl Borrow<str>
) -> Result<DirectorySingle<T>, PathioError>
fn remove_directory( &mut self, path: impl Borrow<str> ) -> Result<DirectorySingle<T>, PathioError>
Removes directory from self or any subdirectory and returns it
source§fn obtain_directory(
&self,
name: impl Borrow<str>
) -> Result<&DirectorySingle<T>, PathioError>
fn obtain_directory( &self, name: impl Borrow<str> ) -> Result<&DirectorySingle<T>, PathioError>
Borrow directory from self
source§fn obtain_directory_mut(
&mut self,
name: impl Borrow<str>
) -> Result<&mut DirectorySingle<T>, PathioError>
fn obtain_directory_mut( &mut self, name: impl Borrow<str> ) -> Result<&mut DirectorySingle<T>, PathioError>
Borrow directory from self
source§fn borrow_directory(
&self,
path: impl Borrow<str>
) -> Result<&DirectorySingle<T>, PathioError>
fn borrow_directory( &self, path: impl Borrow<str> ) -> Result<&DirectorySingle<T>, PathioError>
Borrow directory from self or any subdirectory
source§fn borrow_directory_mut(
&mut self,
path: impl Borrow<str>
) -> Result<&mut DirectorySingle<T>, PathioError>
fn borrow_directory_mut( &mut self, path: impl Borrow<str> ) -> Result<&mut DirectorySingle<T>, PathioError>
Borrow directory from self or any subdirectory
source§fn merge(
&mut self,
directory: impl Into<DirectorySingle<T>>
) -> Result<(), PathioError>
fn merge( &mut self, directory: impl Into<DirectorySingle<T>> ) -> Result<(), PathioError>
Merges PathTree or Directory content into itself
source§impl<T> PathioHierarchy<DirectorySingle<T>> for PathTreeSingle<T>
impl<T> PathioHierarchy<DirectorySingle<T>> for PathTreeSingle<T>
source§fn add_directory(
&mut self,
directory: DirectorySingle<T>,
name: impl Borrow<str>
) -> Result<(), PathioError>
fn add_directory( &mut self, directory: DirectorySingle<T>, name: impl Borrow<str> ) -> Result<(), PathioError>
Adds subdirectory directly to this directory
source§fn insert_directory(
&mut self,
directory: DirectorySingle<T>,
path: impl Borrow<str>
) -> Result<(), PathioError>
fn insert_directory( &mut self, directory: DirectorySingle<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>
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<DirectorySingle<T>, PathioError>
fn take_directory( &mut self, name: impl Borrow<str> ) -> Result<DirectorySingle<T>, PathioError>
Removes directory from self and returns it
source§fn remove_directory(
&mut self,
path: impl Borrow<str>
) -> Result<DirectorySingle<T>, PathioError>
fn remove_directory( &mut self, path: impl Borrow<str> ) -> Result<DirectorySingle<T>, PathioError>
Removes directory from self or any subdirectory and returns it
source§fn obtain_directory(
&self,
name: impl Borrow<str>
) -> Result<&DirectorySingle<T>, PathioError>
fn obtain_directory( &self, name: impl Borrow<str> ) -> Result<&DirectorySingle<T>, PathioError>
Borrow directory from self
source§fn obtain_directory_mut(
&mut self,
name: impl Borrow<str>
) -> Result<&mut DirectorySingle<T>, PathioError>
fn obtain_directory_mut( &mut self, name: impl Borrow<str> ) -> Result<&mut DirectorySingle<T>, PathioError>
Borrow directory from self
source§fn borrow_directory(
&self,
path: impl Borrow<str>
) -> Result<&DirectorySingle<T>, PathioError>
fn borrow_directory( &self, path: impl Borrow<str> ) -> Result<&DirectorySingle<T>, PathioError>
Borrow directory from self or any subdirectory
source§fn borrow_directory_mut(
&mut self,
path: impl Borrow<str>
) -> Result<&mut DirectorySingle<T>, PathioError>
fn borrow_directory_mut( &mut self, path: impl Borrow<str> ) -> Result<&mut DirectorySingle<T>, PathioError>
Borrow directory from self or any subdirectory
source§fn merge(
&mut self,
directory: impl Into<DirectorySingle<T>>
) -> Result<(), PathioError>
fn merge( &mut self, directory: impl Into<DirectorySingle<T>> ) -> Result<(), PathioError>
Merges PathTree or Directory content into itself
impl<T> StructuralPartialEq for DirectorySingle<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for DirectorySingle<T>where T: RefUnwindSafe,
impl<T> Send for DirectorySingle<T>where T: Send,
impl<T> Sync for DirectorySingle<T>where T: Sync,
impl<T> Unpin for DirectorySingle<T>where T: Unpin,
impl<T> UnwindSafe for DirectorySingle<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more