pub trait FileCapability: Clone + Debug {
// Required methods
fn new() -> Self;
fn read(
&self,
path: &str,
) -> impl Future<Output = Result<Bytes, FileError>> + MaybeSend;
fn write(
&self,
path: &str,
contents: Bytes,
) -> impl Future<Output = Result<(), FileError>> + MaybeSend;
fn metadata(
&self,
path: &str,
) -> impl Future<Output = Result<FileMetadata, FileError>> + MaybeSend;
fn exists(
&self,
path: &str,
) -> impl Future<Output = Result<bool, FileError>> + MaybeSend;
}Required Methods§
fn new() -> Self
fn read( &self, path: &str, ) -> impl Future<Output = Result<Bytes, FileError>> + MaybeSend
fn write( &self, path: &str, contents: Bytes, ) -> impl Future<Output = Result<(), FileError>> + MaybeSend
fn metadata( &self, path: &str, ) -> impl Future<Output = Result<FileMetadata, FileError>> + MaybeSend
fn exists( &self, path: &str, ) -> impl Future<Output = Result<bool, FileError>> + MaybeSend
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".