#futures #fs #file #async

fs

A Futures implementation for File System operations

1 unstable release

Uses old Rust 2015

0.0.5 Jun 7, 2019

#27 in #fs

Download history 22/week @ 2021-06-05 19/week @ 2021-06-12 9/week @ 2021-06-19 10/week @ 2021-06-26 13/week @ 2021-07-03 17/week @ 2021-07-10 28/week @ 2021-07-17 17/week @ 2021-07-24 24/week @ 2021-07-31 29/week @ 2021-08-07 12/week @ 2021-08-14 16/week @ 2021-08-21 5/week @ 2021-08-28 19/week @ 2021-09-04 20/week @ 2021-09-11 7/week @ 2021-09-18

54 downloads per month
Used in 5 crates (3 directly)

MIT/Apache

17KB
387 lines

fs

Travis Build Status crates.io docs.rs

Re-published from [futures-fs](https://github.com/seanmonstar/futures-fs), 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

~405KB