Skip to content

Commit 6addb81

Browse files
hjr30xE282B0
authored andcommitted
docs(server): add conn::http1::Builder example (hyperium#3390)
1 parent 4390162 commit 6addb81

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/server/conn/http1.rs

+19
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ pin_project_lite::pin_project! {
4444
///
4545
/// **Note**: The default values of options are *not considered stable*. They
4646
/// are subject to change at any time.
47+
///
48+
/// # Example
49+
///
50+
/// ```
51+
/// # use std::time::Duration;
52+
/// # use hyper::server::conn::http1::Builder;
53+
/// # fn main() {
54+
/// let mut http = Builder::new();
55+
/// // Set options one at a time
56+
/// http.header_read_timeout(Duration::from_millis(200));
57+
///
58+
/// // Or, chain multiple options
59+
/// http.keep_alive(false).title_case_headers(true).max_buf_size(8192);
60+
///
61+
/// # }
62+
/// ```
63+
///
64+
/// Use [`Builder::serve_connection`](struct.Builder.html#method.serve_connection)
65+
/// to bind the built connection to a service.
4766
#[derive(Clone, Debug)]
4867
pub struct Builder {
4968
timer: Time,

0 commit comments

Comments
 (0)