#future #fs-file #file #fs #async

futures-fs

A Futures implementation for File System operations

6 releases

Uses old Rust 2015

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

#1338 in Filesystem

Download history 66/week @ 2024-07-21 176/week @ 2024-07-28 57/week @ 2024-08-04 79/week @ 2024-08-11 78/week @ 2024-08-18 163/week @ 2024-08-25 69/week @ 2024-09-01 100/week @ 2024-09-08 33/week @ 2024-09-15 83/week @ 2024-09-22 44/week @ 2024-09-29 28/week @ 2024-10-06 60/week @ 2024-10-13 46/week @ 2024-10-20 86/week @ 2024-10-27 54/week @ 2024-11-03

249 downloads per month
Used in 4 crates (3 directly)

MIT/Apache

18KB
387 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;

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");

Dependencies

~505KB