@@ -35,6 +35,18 @@ use std::sync::Arc;
3535/// .config(rustls::ServerConfig::new(rustls::NoClientAuth::new()))
3636/// .finish();
3737/// ```
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+
3850pub struct TlsListenerBuilder < State > {
3951 key : Option < PathBuf > ,
4052 cert : Option < PathBuf > ,
@@ -86,6 +98,8 @@ impl<State> std::fmt::Debug for TlsListenerBuilder<State> {
8698 )
8799 . field ( "tcp" , & self . tcp )
88100 . field ( "addrs" , & self . addrs )
101+ . field ( "tcp_nodelay" , & self . tcp_nodelay )
102+ . field ( "tcp_ttl" , & self . tcp_ttl )
89103 . finish ( )
90104 }
91105}
@@ -153,13 +167,13 @@ impl<State> TlsListenerBuilder<State> {
153167 }
154168
155169 /// 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 {
157171 self . tcp_nodelay = Some ( nodelay) ;
158172 self
159173 }
160174
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 {
163177 self . tcp_ttl = Some ( ttl) ;
164178 self
165179 }
0 commit comments