Skip to content
This repository was archived by the owner on Oct 9, 2019. It is now read-only.

Commit 858dbdb

Browse files
committed
rename to async-ready
Signed-off-by: Yoshua Wuyts <[email protected]>
1 parent c3a1d4d commit 858dbdb

File tree

4 files changed

+43
-36
lines changed

4 files changed

+43
-36
lines changed

CHANGELOG.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
## 2019-03-07, Version 1.1.0
22
### Commits
3-
- [[`36ee5ddeb8`](https://github.com/yoshuawuyts/ready/commit/36ee5ddeb8e72af386ee9a17351eeae309e3c98e)] (cargo-release) version 1.1.0 (Yoshua Wuyts)
4-
- [[`21746f6bb6`](https://github.com/yoshuawuyts/ready/commit/21746f6bb6019583b362b98b8090ca05c4ffe136)] add TakeError (Yoshua Wuyts)
5-
- [[`6014621dbe`](https://github.com/yoshuawuyts/ready/commit/6014621dbeb33f7f53ea0517cc59d40a3f030dde)] Update changelog (Yoshua Wuyts)
3+
- [[`36ee5ddeb8`](https://github.com/yoshuawuyts/async-ready/commit/36ee5ddeb8e72af386ee9a17351eeae309e3c98e)] (cargo-release) version 1.1.0 (Yoshua Wuyts)
4+
- [[`21746f6bb6`](https://github.com/yoshuawuyts/async-ready/commit/21746f6bb6019583b362b98b8090ca05c4ffe136)] add TakeError (Yoshua Wuyts)
5+
- [[`6014621dbe`](https://github.com/yoshuawuyts/async-ready/commit/6014621dbeb33f7f53ea0517cc59d40a3f030dde)] Update changelog (Yoshua Wuyts)
66

77
### Stats
88
```diff
@@ -15,9 +15,9 @@
1515

1616
## 2019-03-07, Version 1.0.2
1717
### Commits
18-
- [[`98cecf5a32`](https://github.com/yoshuawuyts/ready/commit/98cecf5a32491a3d9fb238954ba6adbb619f1cf6)] (cargo-release) version 1.0.2 (Yoshua Wuyts)
19-
- [[`ab5beaa174`](https://github.com/yoshuawuyts/ready/commit/ab5beaa174a79cdea95bfbbc640909c0dcf740f8)] fix mutability (Yoshua Wuyts)
20-
- [[`38271c0725`](https://github.com/yoshuawuyts/ready/commit/38271c0725a0cd27d2faffd5ea943c74e74bb718)] Update changelog (Yoshua Wuyts)
18+
- [[`98cecf5a32`](https://github.com/yoshuawuyts/async-ready/commit/98cecf5a32491a3d9fb238954ba6adbb619f1cf6)] (cargo-release) version 1.0.2 (Yoshua Wuyts)
19+
- [[`ab5beaa174`](https://github.com/yoshuawuyts/async-ready/commit/ab5beaa174a79cdea95bfbbc640909c0dcf740f8)] fix mutability (Yoshua Wuyts)
20+
- [[`38271c0725`](https://github.com/yoshuawuyts/async-ready/commit/38271c0725a0cd27d2faffd5ea943c74e74bb718)] Update changelog (Yoshua Wuyts)
2121

2222
### Stats
2323
```diff
@@ -30,9 +30,9 @@
3030

3131
## 2019-03-07, Version 1.0.1
3232
### Commits
33-
- [[`455bd12a1a`](https://github.com/yoshuawuyts/ready/commit/455bd12a1aeac3deae4c8432050b69eced51b956)] (cargo-release) version 1.0.1 (Yoshua Wuyts)
34-
- [[`331b94abd0`](https://github.com/yoshuawuyts/ready/commit/331b94abd01c5848e51584ebf3ce5684cf08dd02)] tweak desc (Yoshua Wuyts)
35-
- [[`9ea6f9f059`](https://github.com/yoshuawuyts/ready/commit/9ea6f9f0594e56261e46261b08ccfdebf7012299)] . (Yoshua Wuyts)
33+
- [[`455bd12a1a`](https://github.com/yoshuawuyts/async-ready/commit/455bd12a1aeac3deae4c8432050b69eced51b956)] (cargo-release) version 1.0.1 (Yoshua Wuyts)
34+
- [[`331b94abd0`](https://github.com/yoshuawuyts/async-ready/commit/331b94abd01c5848e51584ebf3ce5684cf08dd02)] tweak desc (Yoshua Wuyts)
35+
- [[`9ea6f9f059`](https://github.com/yoshuawuyts/async-ready/commit/9ea6f9f0594e56261e46261b08ccfdebf7012299)] . (Yoshua Wuyts)
3636

3737
### Stats
3838
```diff

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "ready"
3-
version = "1.1.0"
2+
name = "async-ready"
3+
version = "1.0.0"
44
license = "MIT OR Apache-2.0"
5-
repository = "https://github.com/yoshuawuyts/ready"
6-
documentation = "https://docs.rs/ready"
7-
description = "Async ready states."
8-
keywords = ["async", "ready", "poll_ready"]
5+
repository = "https://github.com/yoshuawuyts/async-ready"
6+
documentation = "https://docs.rs/async-ready"
7+
description = "Async async-ready states."
8+
keywords = ["async", "ready_state", "poll_ready"]
99
categories = ["asynchronous"]
1010
authors = ["Yoshua Wuyts <[email protected]>"]
1111
readme = "README.md"

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ready
1+
# async-ready
22
[![crates.io version][1]][2] [![build status][3]][4]
33
[![downloads][5]][6] [![docs.rs docs][7]][8]
44

@@ -17,6 +17,7 @@ __Basic usage__
1717
use std::pin::Pin;
1818
use std::task::{Poll, Waker};
1919
use futures::prelude::*;
20+
use async_ready::AsyncReady;
2021
use std::io;
2122

2223
struct Fut;
@@ -28,10 +29,11 @@ impl Future for Fut {
2829
}
2930
}
3031

31-
impl ready::Ready for Fut {
32+
impl AsyncReady for Fut {
3233
type Ok = ();
3334
type Err = io::Error;
34-
fn poll_ready(&self, waker: &Waker)
35+
36+
fn poll_ready(&mut self, waker: &Waker)
3537
-> Poll<Result<Self::Ok, Self::Err>> {
3638
Poll::Ready(Ok(()))
3739
}
@@ -40,7 +42,7 @@ impl ready::Ready for Fut {
4042

4143
## Installation
4244
```sh
43-
$ cargo add ready
45+
$ cargo add async-ready
4446
```
4547

4648
## Safety
@@ -60,16 +62,16 @@ None.
6062
## License
6163
[MIT](./LICENSE-MIT) OR [Apache-2.0](./LICENSE-APACHE)
6264

63-
[1]: https://img.shields.io/crates/v/ready.svg?style=flat-square
64-
[2]: https://crates.io/crates/ready
65-
[3]: https://img.shields.io/travis/yoshuawuyts/ready/master.svg?style=flat-square
66-
[4]: https://travis-ci.org/yoshuawuyts/ready
67-
[5]: https://img.shields.io/crates/d/ready.svg?style=flat-square
68-
[6]: https://crates.io/crates/ready
65+
[1]: https://img.shields.io/crates/v/async-ready.svg?style=flat-square
66+
[2]: https://crates.io/crates/async-ready
67+
[3]: https://img.shields.io/travis/yoshuawuyts/async-ready/master.svg?style=flat-square
68+
[4]: https://travis-ci.org/yoshuawuyts/async-ready
69+
[5]: https://img.shields.io/crates/d/async-ready.svg?style=flat-square
70+
[6]: https://crates.io/crates/async-ready
6971
[7]: https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square
70-
[8]: https://docs.rs/ready
72+
[8]: https://docs.rs/async-ready
7173

72-
[releases]: https://github.com/yoshuawuyts/ready/releases
73-
[contributing]: https://github.com/yoshuawuyts/ready/blob/master.github/CONTRIBUTING.md
74-
[good-first-issue]: https://github.com/yoshuawuyts/ready/labels/good%20first%20issue
75-
[help-wanted]: https://github.com/yoshuawuyts/ready/labels/help%20wanted
74+
[releases]: https://github.com/yoshuawuyts/async-ready/releases
75+
[contributing]: https://github.com/yoshuawuyts/async-ready/blob/master.github/CONTRIBUTING.md
76+
[good-first-issue]: https://github.com/yoshuawuyts/async-ready/labels/good%20first%20issue
77+
[help-wanted]: https://github.com/yoshuawuyts/async-ready/labels/help%20wanted

src/lib.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#![deny(missing_docs)]
44
#![cfg_attr(test, deny(warnings))]
55

6+
//! Async readiness traits. Useful when implementing async state machines
7+
//! that can later be wrapped in dedicated futures.
8+
//!
69
//! ## Example
710
//!
811
//! ```rust
@@ -11,6 +14,7 @@
1114
//! use std::pin::Pin;
1215
//! use std::task::{Poll, Waker};
1316
//! use futures::prelude::*;
17+
//! use async_ready::AsyncReady;
1418
//! use std::io;
1519
//!
1620
//! struct Fut;
@@ -22,9 +26,10 @@
2226
//! }
2327
//! }
2428
//!
25-
//! impl ready::Ready for Fut {
29+
//! impl AsyncReady for Fut {
2630
//! type Ok = ();
2731
//! type Err = io::Error;
32+
//!
2833
//! fn poll_ready(&mut self, waker: &Waker)
2934
//! -> Poll<Result<Self::Ok, Self::Err>> {
3035
//! Poll::Ready(Ok(()))
@@ -37,7 +42,7 @@
3742
use std::task::{Poll, Waker};
3843

3944
/// Determine if the underlying API can be written to.
40-
pub trait WriteReady {
45+
pub trait AsyncWriteReady {
4146
/// The type of successful values yielded by this trait.
4247
type Ok;
4348

@@ -49,7 +54,7 @@ pub trait WriteReady {
4954
}
5055

5156
/// Determine if the underlying API can be read from.
52-
pub trait ReadReady {
57+
pub trait AsyncReadReady {
5358
/// The type of successful values yielded by this trait.
5459
type Ok;
5560

@@ -60,15 +65,15 @@ pub trait ReadReady {
6065
fn poll_read_ready(&mut self, waker: &Waker) -> Poll<Result<Self::Ok, Self::Err>>;
6166
}
6267

63-
/// Determine if a struct is ready to yield futures.
68+
/// Determine if a struct is async-ready to yield futures.
6469
///
6570
/// This is useful when a `Stream` borrows an internal struct, and the internal
6671
/// struct is in charge of establishing the io channel. That way the stream and
6772
/// the readiness can be decoupled.
6873
///
69-
/// Once the IO channel is ready, `poll_ready` should always return
74+
/// Once the IO channel is async-ready, `poll_async-ready` should always return
7075
/// `Poll::Ready`.
71-
pub trait Ready {
76+
pub trait AsyncReady {
7277
/// The type of successful values yielded by this trait.
7378
type Ok;
7479

0 commit comments

Comments
 (0)