@@ -35,6 +35,18 @@ use std::sync::Arc;
35
35
/// .config(rustls::ServerConfig::new(rustls::NoClientAuth::new()))
36
36
/// .finish();
37
37
/// ```
38
+ ///
39
+ /// ```rust
40
+ /// # use tide_rustls::TlsListener;
41
+ /// let listener = TlsListener::<()>::build()
42
+ /// .addrs("localhost:4433")
43
+ /// .cert("./tls/localhost-4433.cert")
44
+ /// .key("./tls/localhost-4433.key")
45
+ /// .tcp_ttl(60)
46
+ /// .tcp_nodelay(true)
47
+ /// .finish();
48
+ /// ```
49
+
38
50
pub struct TlsListenerBuilder < State > {
39
51
key : Option < PathBuf > ,
40
52
cert : Option < PathBuf > ,
@@ -86,6 +98,8 @@ impl<State> std::fmt::Debug for TlsListenerBuilder<State> {
86
98
)
87
99
. field ( "tcp" , & self . tcp )
88
100
. field ( "addrs" , & self . addrs )
101
+ . field ( "tcp_nodelay" , & self . tcp_nodelay )
102
+ . field ( "tcp_ttl" , & self . tcp_ttl )
89
103
. finish ( )
90
104
}
91
105
}
@@ -153,13 +167,13 @@ impl<State> TlsListenerBuilder<State> {
153
167
}
154
168
155
169
/// Provides a TCP_NODELAY option for this tls listener.
156
- pub fn nodelay ( mut self , nodelay : bool ) -> Self {
170
+ pub fn tcp_nodelay ( mut self , nodelay : bool ) -> Self {
157
171
self . tcp_nodelay = Some ( nodelay) ;
158
172
self
159
173
}
160
174
161
- /// Provides a TTL option for this tls listener.
162
- pub fn ttl ( mut self , ttl : u32 ) -> Self {
175
+ /// Provides a TTL option for this tls listener, in seconds .
176
+ pub fn tcp_ttl ( mut self , ttl : u32 ) -> Self {
163
177
self . tcp_ttl = Some ( ttl) ;
164
178
self
165
179
}
0 commit comments