Trait pathio::PathioFileStorage
source · pub trait PathioFileStorage<T> {
// Required methods
fn add_file(
&mut self,
file: T,
name: impl Borrow<str>
) -> Result<(), PathioError>;
fn insert_file(
&mut self,
file: T,
path: impl Borrow<str>
) -> Result<(), PathioError>;
fn take_file(&mut self, name: impl Borrow<str>) -> Result<T, PathioError>;
fn remove_file(&mut self, path: impl Borrow<str>) -> Result<T, PathioError>;
fn obtain_file(&self, name: impl Borrow<str>) -> Result<&T, PathioError>;
fn obtain_file_mut(
&mut self,
name: impl Borrow<str>
) -> Result<&mut T, PathioError>;
fn borrow_file(&self, path: impl Borrow<str>) -> Result<&T, PathioError>;
fn borrow_file_mut(
&mut self,
path: impl Borrow<str>
) -> Result<&mut T, PathioError>;
}Required Methods§
sourcefn add_file(
&mut self,
file: T,
name: impl Borrow<str>
) -> Result<(), PathioError>
fn add_file( &mut self, file: T, name: impl Borrow<str> ) -> Result<(), PathioError>
Adds file directly to this directory
sourcefn insert_file(
&mut self,
file: T,
path: impl Borrow<str>
) -> Result<(), PathioError>
fn insert_file( &mut self, file: T, path: impl Borrow<str> ) -> Result<(), PathioError>
Inserts file to self or any subdirectory
sourcefn take_file(&mut self, name: impl Borrow<str>) -> Result<T, PathioError>
fn take_file(&mut self, name: impl Borrow<str>) -> Result<T, PathioError>
Removes file from self and returns it
sourcefn remove_file(&mut self, path: impl Borrow<str>) -> Result<T, PathioError>
fn remove_file(&mut self, path: impl Borrow<str>) -> Result<T, PathioError>
Removes file from self or any subdirectory and returns it
sourcefn obtain_file(&self, name: impl Borrow<str>) -> Result<&T, PathioError>
fn obtain_file(&self, name: impl Borrow<str>) -> Result<&T, PathioError>
Borrow file from self
sourcefn obtain_file_mut(
&mut self,
name: impl Borrow<str>
) -> Result<&mut T, PathioError>
fn obtain_file_mut( &mut self, name: impl Borrow<str> ) -> Result<&mut T, PathioError>
Borrow file from self
sourcefn borrow_file(&self, path: impl Borrow<str>) -> Result<&T, PathioError>
fn borrow_file(&self, path: impl Borrow<str>) -> Result<&T, PathioError>
Borrow file from self or any subdirectory
sourcefn borrow_file_mut(
&mut self,
path: impl Borrow<str>
) -> Result<&mut T, PathioError>
fn borrow_file_mut( &mut self, path: impl Borrow<str> ) -> Result<&mut T, PathioError>
Borrow file from self or any subdirectory