pub trait FileOpener: Send + Sync + 'static {
    type File: IntoFileAccess;
    type Future: Future<Output = Result<FileWithMetadata<Self::File>, Error>> + Send;

    // Required method
    fn open(&self, path: &Path) -> Self::Future;
}
Expand description

Trait for a simple virtual filesystem layer.

There is only the open operation, hence the name FileOpener. In practice, open must also collect some file metadata. (See the FileWithMetadata struct.)

Required Associated Types§

source

type File: IntoFileAccess

File handle type.

source

type Future: Future<Output = Result<FileWithMetadata<Self::File>, Error>> + Send

Future type that open returns.

Required Methods§

source

fn open(&self, path: &Path) -> Self::Future

Open a file and return a FileWithMetadata.

It can be assumed the path is already sanitized at this point.

Implementors§