#futures #fs #file #async

futures-fs

A Futures implementation for File System operations

6 releases

0.0.5 Oct 9, 2018
0.0.4 Apr 27, 2018
0.0.3 Sep 28, 2017
0.0.2 May 21, 2017
0.0.0 Feb 23, 2017

#13 in #fs

Download history 482/week @ 2020-02-08 253/week @ 2020-02-15 310/week @ 2020-02-22 378/week @ 2020-02-29 397/week @ 2020-03-07 411/week @ 2020-03-14 438/week @ 2020-03-21 572/week @ 2020-03-28 814/week @ 2020-04-04 496/week @ 2020-04-11 1022/week @ 2020-04-18 485/week @ 2020-04-25 371/week @ 2020-05-02 480/week @ 2020-05-09 652/week @ 2020-05-16 349/week @ 2020-05-23

1,895 downloads per month
Used in 4 crates (3 directly)

MIT/Apache

17KB
388 lines

futures-fs

Travis Build Status crates.io docs.rs

Access File System operations off-thread, using Futures and Streams.

Usage

let fs = FsPool::default();

// our source file
let read = fs.read("/home/sean/foo.txt", Default::default());

// default writes options to create a new file
let write = fs.write("/home/sean/out.txt", Default::default());

// block this thread!
// the reading and writing however will happen off-thread
read.forward(write).wait()
    .expect("IO error piping foo.txt to out.txt");

lib.rs:

A thread pool to handle file IO operations.

Examples

extern crate futures;
extern crate futures_fs;

use futures::{Future, Stream};
use futures_fs::FsPool;

# fn run() {
let fs = FsPool::default();

// our source file
let read = fs.read("/home/sean/foo.txt", Default::default());

// default writes options to create a new file
let write = fs.write("/home/sean/out.txt", Default::default());

// block this thread!
// the reading and writing however will happen off-thread
read.forward(write).wait()
    .expect("IO error piping foo.txt to out.txt");
# }
# fn main() {}

Dependencies

~375KB