Skip to content

Commit 694e46d

Browse files
Ruben24240xE282B0
authored andcommitted
docs(example): document the single-threaded example (hyperium#3271)
Signed-off-by: Sven Pfennig <[email protected]>
1 parent 5400295 commit 694e46d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

examples/single_threaded.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#![deny(warnings)]
2-
2+
/// This example shows how to use hyper with a single-threaded runtime.
3+
/// This example exists also to test if the code compiles when `Body` is not `Send`.
4+
///
5+
/// This Example includes HTTP/1 and HTTP/2 server and client.
6+
///
7+
/// In HTTP/1 it is possible to use a `!Send` `Body`type.
8+
/// In HTTP/2 it is possible to use a `!Send` `Body` and `IO` type.
9+
///
10+
/// The `Body` and `IOTypeNotSend` structs in this example are `!Send`
11+
///
12+
/// For HTTP/2 this only works if the `Executor` trait is implemented without the `Send` bound.
313
use http_body_util::BodyExt;
414
use hyper::server::conn::http2;
515
use std::cell::Cell;

0 commit comments

Comments
 (0)