Trait pathio::PathioFile
source · pub trait PathioFile<T> {
// Required methods
fn add_file(&mut self, file: T) -> Option<T>;
fn insert_file(
&mut self,
file: T,
path: impl Borrow<str>
) -> Result<Option<T>, PathioError>;
fn take_file(&mut self) -> Option<T>;
fn remove_file(
&mut self,
path: impl Borrow<str>
) -> Result<Option<T>, PathioError>;
fn obtain_file(&self) -> Option<&T>;
fn obtain_file_mut(&mut self) -> Option<&mut T>;
fn borrow_file(
&self,
path: impl Borrow<str>
) -> Result<Option<&T>, PathioError>;
fn borrow_file_mut(
&mut self,
path: impl Borrow<str>
) -> Result<Option<&mut T>, PathioError>;
}Required Methods§
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn obtain_file(&self) -> Option<&T>
fn obtain_file(&self) -> Option<&T>
Borrow file from self
sourcefn obtain_file_mut(&mut self) -> Option<&mut T>
fn obtain_file_mut(&mut self) -> Option<&mut T>
Borrow file from self
sourcefn 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
sourcefn 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