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

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

#1064 in Filesystem

Download history 45/week @ 2023-12-18 36/week @ 2023-12-25 29/week @ 2024-01-01 33/week @ 2024-01-08 52/week @ 2024-01-15 56/week @ 2024-01-22 31/week @ 2024-01-29 31/week @ 2024-02-05 65/week @ 2024-02-12 61/week @ 2024-02-19 67/week @ 2024-02-26 61/week @ 2024-03-04 78/week @ 2024-03-11 65/week @ 2024-03-18 48/week @ 2024-03-25 242/week @ 2024-04-01

440 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

~490KB