Commit Graph

55 Commits (1d875836a2302681a395ee44512a518f0222da4a)

Author SHA1 Message Date
k-nasa 2221441a4c feat: Implement Clone trait for DirEntry 5 years ago
Yoshua Wuyts 46cafffc31
Merge pull request #571 from killercup/more-errors
Add context to more errors
5 years ago
Pascal Hertleif aa7d1c27a4
Verbose errors: Apply suggestions
Co-Authored-By: Yoshua Wuyts <yoshuawuyts+github@gmail.com>
5 years ago
Stjepan Glavina 16edec3464 Ignore seek errors in poll_unread 5 years ago
Pascal Hertleif e01f07d72a Add context to more errors
cc #569
5 years ago
Yoshua Wuyts 2ca03cabe6
Merge pull request #552 from hhggit/win_symlink
add os::windows::symlink_{dir,file}
5 years ago
Pascal Hertleif c704643296 Remove verbose-errors cargo feature 5 years ago
hhggit 2c9b558d14 add os::windows::symlink_{dir,file} 5 years ago
Pascal Hertleif 8ce3e78952 verbose errors feature
This adds a new "verbose-errors" feature flag to async-std that enables
wrapping certain errors in structures with more context. As an example,
we use it in `fs::File::{open,create}` to add the given path to the
error message (something that is lacking in std to annoyance of many).
5 years ago
Stjepan Glavina 548733e5d5
Cleanup stream traits (#487)
* Cleanup stream traits

* Fix docs
5 years ago
Stjepan Glavina 3dd59d7056
Refactor the task module (#421)
* Refactor the task module

* Fix clippy warning

* Simplify task-local entries

* Reduce the amount of future wrapping

* Cleanup

* Simplify stealing
5 years ago
Stjepan Glavina 8bef2e9e95 Don't flush files if they weren't written to 5 years ago
Stjepan Glavina ec23632f3e
Cleanup: replace cfg-if with our macros (#361)
* Cleanup: replace cfg-if with our macros

* Prefix macros with cfg_

* Remove #[macro_export] from internal macros
5 years ago
Yoshua Wuyts 49faea2023 init FutureExt (#308)
* init FutureExt

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>

* prelude

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>

* Refactor extension_trait

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>

* Fix rustdoc

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts b4c1c63fd2
task::blocking async closure -> FnOnce
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Stjepan Glavina 504f8cb137 Use crate::path everywhere 5 years ago
Stjepan Glavina f9cfee9e2c Formatting 5 years ago
Stjepan Glavina 0adcb50f58 Add ToOwned and Borrow impls 5 years ago
Wouter Geraedts d349333a43 Implemented Path::read_link 5 years ago
Wouter Geraedts 89f73d3eda Implemented Path::read_dir 5 years ago
Wouter Geraedts 6c6106a292 Implemented Path::{metadata, symlink_metadata} 5 years ago
Wouter Geraedts e690b55b18 Implemented fs::metadata and Path::exists 5 years ago
Wouter Geraedts e27b578c27 WIP init Path and PathBuf async stubs 5 years ago
Yoshua Wuyts 9ab7b1ae6e
Merge pull request #251 from async-rs/blocking-unstable
add an unstable `task::blocking` function
5 years ago
Yoshua Wuyts c27623c0fd
cargo fmt
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Yoshua Wuyts 647aab819f
impl feedback
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
k-nasa 6253e97717 feat: Add Default trait 5 years ago
Stjepan Glavina 73d7fea937 Re-export Stream from futures 5 years ago
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>
5 years ago
Stjepan Glavina 53ce30ae66
Fix async_std imports in metadata.rs 5 years ago
Stjepan Glavina 1fa196812a Fix compilation errors around Stream 5 years ago
Stjepan Glavina edfa2358a4 Re-export IO traits from futures 5 years ago
Stjepan Glavina 7f71af9415 cargo fmt 5 years ago
Stjepan Glavina a4381230b8 Clean up the fs module and a few other places 5 years ago
Stjepan Glavina 2c02037673 Fix a typo 5 years ago
Stjepan Glavina 41f345d319 Fix a bug in conversion of File into raw handle 5 years ago
Stjepan Glavina 8c00cc53ce Flush more often to prevent flushes during seek 5 years ago
Stjepan Glavina 6ed0e857fd Fix some typos, expand comments 5 years ago
Stjepan Glavina 17c95a39d7
More robust file implementation
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Stjepan Glavina bac74c2d7f
Reduce dependency on futures crate (#140)
* Add future::poll_fn

* Replace all uses of poll_fn with the new one

* Remove some uses of futures

* Simplify ReadDir and DirEntry

* Remove some use of futures from File

* Use futures subcrates

* Fix imports in docs

* Remove futures-util dependency

* Remove futures-executor-preview

* Refactor

* Require more features in the futures-preview crate
5 years ago
Dylan Frankland d47f7d3e92 rustfmt fs::create_dir_all 5 years ago
Dylan Frankland c21e381098 Remove unused import from fs::create_dir_all 5 years ago
Dylan Frankland 8451789da5 Expose fs::create_dir_all 5 years ago
Yoshua Wuyts 63ad786768
remove async_await feature gate
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
5 years ago
Stjepan Glavina 9b3e8b8f26 Use our own Sink/Empty and fix compilation errors 5 years ago
Stjepan Glavina e459bd048e Cleanup and docs 5 years ago
Stjepan Glavina 019c8085f4 Cleanup examples 5 years ago
Stjepan Glavina 1f9628d8ad Cleanup 5 years ago
Stjepan Glavina 9d8ac36813 Rename feature docs.rs to docs 5 years ago
Stjepan Glavina 756da0e89d Modularize 5 years ago