async-std/src/fs
bors[bot] 33ff41df48
Merge #224
224: Re-export IO traits from futures r=stjepang a=stjepang

Sorry for the big PR!

Instead of providing our own traits `async_std::io::{Read, Write, Seek, BufRead}`, we now re-export `futures::io::{AsyncRead, AsyncWrite, AsyncSeek, AsyncRead}`. While re-exporting we rename them to strip away the "Async" prefix.

The documentation will display the contents of the original traits from the `futures` crate together with our own extension methods. There's a note in the docs saying the extenion methods become available only when `async_std::prelude::*` is imported.

Our extension traits are re-exported into the prelude, but are marked with `#[doc(hidden)]` so they're completely invisible to users.

The benefit of this is that people can now implement traits from `async_std::io` for their types and stay compatible with `futures`. This will also simplify some trait bounds in our APIs - for example, things like `where Self: futures_io::AsyncRead`.

At the same time, I cleaned up some trait bounds in our stream interfaces, but haven't otherwise fiddled with them much.

I intend to follow up with another PR doing the same change for `Stream` so that we re-export the stream trait from `futures`.

Co-authored-by: Stjepan Glavina <stjepang@gmail.com>
2019-09-22 13:50:53 +00:00
..
canonicalize.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
copy.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
create_dir.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
create_dir_all.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
dir_builder.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
dir_entry.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
file.rs Fix compilation errors around Stream 2019-09-21 15:05:57 +02:00
file_type.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
hard_link.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
metadata.rs Fix async_std imports in metadata.rs 2019-09-21 15:17:49 +02:00
mod.rs cargo fmt 2019-09-14 09:15:51 +02:00
open_options.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
permissions.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
read.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
read_dir.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
read_link.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
read_to_string.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
remove_dir.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
remove_dir_all.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
remove_file.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
rename.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
set_permissions.rs cargo fmt 2019-09-14 09:15:51 +02:00
symlink_metadata.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00
write.rs Clean up the fs module and a few other places 2019-09-14 01:24:31 +02:00