Skip to main content

FileCapability

Trait FileCapability 

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

Source

fn new() -> Self

Source

fn read( &self, path: &str, ) -> impl Future<Output = Result<Bytes, FileError>> + MaybeSend

Source

fn write( &self, path: &str, contents: Bytes, ) -> impl Future<Output = Result<(), FileError>> + MaybeSend

Source

fn metadata( &self, path: &str, ) -> impl Future<Output = Result<FileMetadata, FileError>> + MaybeSend

Source

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

Implementors§