Skip to content

Commit 8a971a7

Browse files
committed
final touches
1 parent a524ac5 commit 8a971a7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@
1010
//! #[async_std::main]
1111
//! async fn main() -> http_types::Result<()> {
1212
//! let buf = Cursor::new(vec![]);
13+
//!
14+
//! // Encode messages to an AsyncWrite.
1315
//! let mut encoder = encode(buf);
1416
//! encoder.send("cat", b"chashu", None).await?;
1517
//!
1618
//! let mut buf = encoder.into_writer();
1719
//! buf.set_position(0);
1820
//!
21+
//! // Decode messages from an AsyncRead.
1922
//! let mut reader = decode(buf);
20-
//! let event: Event = reader.next().await.unwrap()?;
23+
//! let event = reader.next().await.unwrap()?;
24+
//! // Match and handle the event
25+
//!
2126
//! # let _ = event;
2227
//! Ok(())
2328
//! }

0 commit comments

Comments
 (0)