From 853656c938effe916fba828c7eac2852456efcde Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 6 Dec 2017 16:24:15 +0100 Subject: [PATCH 1/2] Add doc and README for rw-stream-sink --- rw-stream-sink/README.md | 7 +++++++ rw-stream-sink/src/lib.rs | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 rw-stream-sink/README.md diff --git a/rw-stream-sink/README.md b/rw-stream-sink/README.md new file mode 100644 index 00000000..1efdd0f5 --- /dev/null +++ b/rw-stream-sink/README.md @@ -0,0 +1,7 @@ +This crate provides the `RwStreamSink` type. It wraps around a `Stream + Sink` that produces +byte arrays, and implements `AsyncRead` and `AsyncWrite`. + +Each call to `write()` will send one packet on the sink. Calls to `read()` will read from +incoming packets. + +> **Note**: This crate is mostly a utility crate and is not at all specific to libp2p. diff --git a/rw-stream-sink/src/lib.rs b/rw-stream-sink/src/lib.rs index 29ca2060..7992d857 100644 --- a/rw-stream-sink/src/lib.rs +++ b/rw-stream-sink/src/lib.rs @@ -18,8 +18,16 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +// TODO: use this once stable ; for now we just copy-paste the content of the README.md +//#![doc(include = "../README.md")] + //! This crate provides the `RwStreamSink` type. It wraps around a `Stream + Sink` that produces //! byte arrays, and implements `AsyncRead` and `AsyncWrite`. +//! +//! Each call to `write()` will send one packet on the sink. Calls to `read()` will read from +//! incoming packets. +//! +//! > **Note**: This crate is mostly a utility crate and is not at all specific to libp2p. extern crate bytes; extern crate futures; From f3f9c214e063ca61b7f2c01b0847212a7e22cfbb Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 7 Dec 2017 12:59:46 +0100 Subject: [PATCH 2/2] Fix concerns --- rw-stream-sink/README.md | 5 +++-- rw-stream-sink/src/lib.rs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rw-stream-sink/README.md b/rw-stream-sink/README.md index 1efdd0f5..6d54ed54 100644 --- a/rw-stream-sink/README.md +++ b/rw-stream-sink/README.md @@ -1,7 +1,8 @@ This crate provides the `RwStreamSink` type. It wraps around a `Stream + Sink` that produces -byte arrays, and implements `AsyncRead` and `AsyncWrite`. +and accepts byte arrays, and implements `AsyncRead` and `AsyncWrite`. Each call to `write()` will send one packet on the sink. Calls to `read()` will read from incoming packets. -> **Note**: This crate is mostly a utility crate and is not at all specific to libp2p. +> **Note**: Although this crate is hosted in the libp2p repo, it is purely a utility crate and +> not at all specific to libp2p. diff --git a/rw-stream-sink/src/lib.rs b/rw-stream-sink/src/lib.rs index 7992d857..b9de4e5f 100644 --- a/rw-stream-sink/src/lib.rs +++ b/rw-stream-sink/src/lib.rs @@ -22,12 +22,13 @@ //#![doc(include = "../README.md")] //! This crate provides the `RwStreamSink` type. It wraps around a `Stream + Sink` that produces -//! byte arrays, and implements `AsyncRead` and `AsyncWrite`. +//! and accepts byte arrays, and implements `AsyncRead` and `AsyncWrite`. //! //! Each call to `write()` will send one packet on the sink. Calls to `read()` will read from //! incoming packets. //! -//! > **Note**: This crate is mostly a utility crate and is not at all specific to libp2p. +//! > **Note**: Although this crate is hosted in the libp2p repo, it is purely a utility crate and +//! > not at all specific to libp2p. extern crate bytes; extern crate futures;