-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Description
- I have looked for existing issues (including closed) about this
Feature Request
Motivation
when using SpaRouter
, it needs a real dir in the fs, however, sometimes the resources may include in the binary by something like include_dir!
.
If SpaRouter
allows using a virtual dir to access the resources, it will increase the practical
Proposal
maybe SpaRouter
can provide a trait like
trait VirtualDir {
type VirtualFile: AsyncRead + AsyncWrite + AsyncSeek + Unpin + Send + 'static;
type VirtualFilenameStream: Stream<Item=io::Result<PathBuf>> + Unpin + Send + 'static;
async fn open_file(&self, name: &str) -> io::Result<Self::VirtualFile>;
async fn list_files(&self, dir: &str) -> io::Result<Self::VirtualFilenameStream>;
}
to allow user pass a virtual dir to the SpaRouter
Alternatives
user can also try to write the file data to a tmp dir and let SpaRouter
access them, but I don't think this way is a good idea
Metadata
Metadata
Assignees
Labels
No labels