Expand description
Asynchronous filesystem operations backed by a dedicated blocking thread pool.
§Examples
use fs::FsPool;
use futures::executor::block_on;
use futures::StreamExt;
use std::io;
fn main() -> io::Result<()> {
let fs = FsPool::default();
block_on(async {
let reader = fs.read("input.txt", Default::default());
let writer = fs.write("output.txt", Default::default());
reader.forward(writer).await
})
}Structs§
- FsFuture
- A future representing work in the
FsPool. - FsPool
- A pool of threads to handle file IO.
- FsRead
Stream - A stream of byte chunks read from a target file.
- FsWrite
Sink - A sink that writes byte chunks to a target file.
- Read
Options - Options for how to read the file.
- Write
Options - Options for how to write to the target file.