Trait hyper_staticfile::vfs::FileOpener
source · 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§
sourcetype File: IntoFileAccess
type File: IntoFileAccess
File handle type.