IoTrait

Trait IoTrait 

Source
pub trait IoTrait: Sync {
    type DirEntry: DirEntry;
    type ReadDirStream: Stream<Item = Result<Self::DirEntry>> + Unpin + Send;
    type FileStream: FileStream;

Show 14 methods // Required methods fn create_dir_all( &self, path: &Path, ) -> impl Future<Output = Result<()>> + Send; fn write( &self, path: &Path, content: &[u8], ) -> impl Future<Output = Result<()>> + Send; fn write_sync( &self, path: &Path, content: &[u8], ) -> impl Future<Output = Result<()>> + Send; fn remove_file( &self, path: &Path, ) -> impl Future<Output = Result<()>> + Send; fn remove_dir(&self, path: &Path) -> impl Future<Output = Result<()>> + Send; fn remove_dir_all( &self, path: &Path, ) -> impl Future<Output = Result<()>> + Send; fn rename( &self, from: &Path, to: &Path, ) -> impl Future<Output = Result<()>> + Send; fn metadata( &self, path: &Path, ) -> impl Future<Output = Result<Metadata>> + Send; fn read_dir( &self, path: &Path, ) -> impl Future<Output = Result<Self::ReadDirStream>> + Send; fn create_new( &self, path: &Path, ) -> impl Future<Output = Result<Self::FileStream>> + Send; fn create( &self, path: &Path, ) -> impl Future<Output = Result<Self::FileStream>> + Send; fn open( &self, path: &Path, ) -> impl Future<Output = Result<Self::FileStream>> + Send; // Provided methods fn is_file(&self, path: &Path) -> impl Future<Output = bool> + Send { ... } fn is_dir(&self, path: &Path) -> impl Future<Output = bool> + Send { ... }
}

Required Associated Types§

Required Methods§

Source

fn create_dir_all(&self, path: &Path) -> impl Future<Output = Result<()>> + Send

Source

fn write( &self, path: &Path, content: &[u8], ) -> impl Future<Output = Result<()>> + Send

Source

fn write_sync( &self, path: &Path, content: &[u8], ) -> impl Future<Output = Result<()>> + Send

Source

fn remove_file(&self, path: &Path) -> impl Future<Output = Result<()>> + Send

Source

fn remove_dir(&self, path: &Path) -> impl Future<Output = Result<()>> + Send

Source

fn remove_dir_all(&self, path: &Path) -> impl Future<Output = Result<()>> + Send

Source

fn rename( &self, from: &Path, to: &Path, ) -> impl Future<Output = Result<()>> + Send

Source

fn metadata(&self, path: &Path) -> impl Future<Output = Result<Metadata>> + Send

Source

fn read_dir( &self, path: &Path, ) -> impl Future<Output = Result<Self::ReadDirStream>> + Send

Source

fn create_new( &self, path: &Path, ) -> impl Future<Output = Result<Self::FileStream>> + Send

Source

fn create( &self, path: &Path, ) -> impl Future<Output = Result<Self::FileStream>> + Send

Source

fn open( &self, path: &Path, ) -> impl Future<Output = Result<Self::FileStream>> + Send

Provided Methods§

Source

fn is_file(&self, path: &Path) -> impl Future<Output = bool> + Send

Source

fn is_dir(&self, path: &Path) -> impl Future<Output = bool> + Send

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§

Source§

impl<T: TokioIoTraitImpl + Sync> IoTrait for T