pub trait UnifiedFs {
type ErrRes: Display;
type FileOp;
// Required methods
async fn metadata(path: &Path) -> Result<Metadata, Self::ErrRes>;
async fn open<P: AsRef<Path>>(path: P) -> Result<Self::FileOp>;
async fn read_to_string(
file: &mut Self::FileOp,
buf: &mut String,
) -> Result<usize>;
}Expand description
A trait which unifies the file IO operations.
Required Associated Types§
Required Methods§
Sourceasync fn metadata(path: &Path) -> Result<Metadata, Self::ErrRes>
async fn metadata(path: &Path) -> Result<Metadata, Self::ErrRes>
Get the metadata for the file specified by the argument path.
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.