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§
type DirEntry: DirEntry
type ReadDirStream: Stream<Item = Result<Self::DirEntry>> + Unpin + Send
type FileStream: FileStream
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
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.