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§

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

Implementors§