Skip to main content

Crate fs

Crate fs 

Source
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.
FsReadStream
A stream of byte chunks read from a target file.
FsWriteSink
A sink that writes byte chunks to a target file.
ReadOptions
Options for how to read the file.
WriteOptions
Options for how to write to the target file.