We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a524ac5 commit 8a971a7Copy full SHA for 8a971a7
src/lib.rs
@@ -10,14 +10,19 @@
10
//! #[async_std::main]
11
//! async fn main() -> http_types::Result<()> {
12
//! let buf = Cursor::new(vec![]);
13
+//!
14
+//! // Encode messages to an AsyncWrite.
15
//! let mut encoder = encode(buf);
16
//! encoder.send("cat", b"chashu", None).await?;
17
//!
18
//! let mut buf = encoder.into_writer();
19
//! buf.set_position(0);
20
21
+//! // Decode messages from an AsyncRead.
22
//! let mut reader = decode(buf);
-//! let event: Event = reader.next().await.unwrap()?;
23
+//! let event = reader.next().await.unwrap()?;
24
+//! // Match and handle the event
25
26
//! # let _ = event;
27
//! Ok(())
28
//! }
0 commit comments