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§

source

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>

Inserts file to self or any subdirectory and return existing one

source

fn take_file(&mut self) -> Option<T>

Removes file from self and returns it

source

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>

Borrow file from self

source

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>

Borrow file from self or any subdirectory

source

fn borrow_file_mut( &mut self, path: impl Borrow<str> ) -> Result<Option<&mut T>, PathioError>

Borrow file from self or any subdirectory

Implementors§