Skip to main content

AsyncFileSystem

Trait AsyncFileSystem 

Source
pub trait AsyncFileSystem:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn read(
        &self,
        path: &Path,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'static>>;
    fn write(
        &self,
        path: &Path,
        contents: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>;
    fn remove_file(
        &self,
        path: &Path,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>;
    fn create_dir_all(
        &self,
        path: &Path,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>;
    fn exists(
        &self,
        path: &Path,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'static>>;
}

Required Methods§

Source

fn read( &self, path: &Path, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'static>>

Source

fn write( &self, path: &Path, contents: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>

Source

fn remove_file( &self, path: &Path, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>

Source

fn create_dir_all( &self, path: &Path, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>

Source

fn exists( &self, path: &Path, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'static>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§