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

    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§

File handle type.

Future type that open returns.

Required Methods§

Open a file and return a FileWithMetadata.

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

Implementors§