pub trait Directory: Sized {
    // Required methods
    fn open_dir_readonly<P: AsRef<Path> + Send>(
        &self,
        relative_path: P
    ) -> Result<Self>;
    fn open_dir_readwrite<P: AsRef<Path> + Send>(
        &self,
        relative_path: P
    ) -> Result<Self>;
    fn create_dir<P: AsRef<Path> + Send>(
        &self,
        relative_path: P,
        readwrite: bool
    ) -> Result<Self>;
    fn clone(&self) -> Result<Self>;
    fn read_file<'life0, 'async_trait, P>(
        &'life0 self,
        relative_path: P
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where P: 'async_trait + AsRef<Path> + Send,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn read_file_bytes<'life0, 'async_trait, P>(
        &'life0 self,
        relative_path: P
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where P: 'async_trait + AsRef<Path> + Send,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filename: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn entry_type<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filename: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Option<DirentKind>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        relative_path: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn write_file<'life0, 'life1, 'async_trait, P>(
        &'life0 self,
        relative_path: P,
        data: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where P: 'async_trait + AsRef<Path> + Send,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_file_size<'life0, 'async_trait, P>(
        &'life0 self,
        relative_path: P
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where P: 'async_trait + AsRef<Path> + Send,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn entry_names<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn open_dir_readonly<P: AsRef<Path> + Send>( &self, relative_path: P ) -> Result<Self>

Attempts to open the directory at relative_path with read-only rights.

source

fn open_dir_readwrite<P: AsRef<Path> + Send>( &self, relative_path: P ) -> Result<Self>

Attempts to open the directory at relative_path with read/write rights.

source

fn create_dir<P: AsRef<Path> + Send>( &self, relative_path: P, readwrite: bool ) -> Result<Self>

Attempts to create a directory at relative_path with read right (if readwrite is false) or read/write rights (if readwrite is true).

source

fn clone(&self) -> Result<Self>

Return a copy of self.

source

fn read_file<'life0, 'async_trait, P>( &'life0 self, relative_path: P ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Returns the contents of the file at relative_path as a string.

source

fn read_file_bytes<'life0, 'async_trait, P>( &'life0 self, relative_path: P ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Returns the contents of the file at relative_path as bytes.

source

fn exists<'life0, 'life1, 'async_trait>( &'life0 self, filename: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns true if an entry called filename exists in this directory. filename must be a plain file name, not a relative path.

source

fn entry_type<'life0, 'life1, 'async_trait>( &'life0 self, filename: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Option<DirentKind>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the type of entry specified by filename, or None if no entry by that name is found. filename must be a plan file name, not a relative path.

source

fn remove<'life0, 'life1, 'async_trait>( &'life0 self, relative_path: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes the file at relative_path.

source

fn write_file<'life0, 'life1, 'async_trait, P>( &'life0 self, relative_path: P, data: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Writes data to a file at relative_path. Overwrites if the file already exists.

source

fn get_file_size<'life0, 'async_trait, P>( &'life0 self, relative_path: P ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where P: 'async_trait + AsRef<Path> + Send, Self: 'async_trait, 'life0: 'async_trait,

Returns the size of the file at relative_path in bytes.

source

fn entry_names<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a list of directory entry names as strings.

Object Safety§

This trait is not object safe.

Implementors§