Trait hyper_staticfile::vfs::FileOpener
source · pub trait FileOpener {
type File;
type Future: Future<Output = Result<FileWithMetadata<Self::File>, Error>>;
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.)
In order to use an implementation with the other parts of this crate (ie. resolver and
response builders), it must be marked Send
and Sync
, and must have 'static
lifetime.