futures-fs
futures-fs copied to clipboard
Support for accessing metadata?
For purposes of HTTP caching, it would be good to have access to the metadata of the file, specifically to get the modification time. I was thinking a structure mimicking Hyper would be reasonable:
struct AsyncFileRequest(/* ... */);
impl Future for AsyncFileRequest {
type Item = Something;
type Err = std::io::Err;
}
struct Something {
metadata: std::fs::Metadata,
body: AsyncFileBodyRequest,
}
impl Stream for AsyncFileBodyRequest {
type Item = Bytes;
type Err = std::io::Err;
}
Does something along these lines seem reasonable?
I think adding fs.metadata(path) -> MetadataFuture makes a lot of sense!