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§
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>>
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.