@@ -36,7 +36,7 @@ pub trait NetworkListener: Clone {
36
36
}
37
37
}
38
38
39
- /// An iterator wrapper over a NetworkAcceptor.
39
+ /// An iterator wrapper over a ` NetworkAcceptor` .
40
40
pub struct NetworkConnections < ' a , N : NetworkListener + ' a > ( & ' a mut N ) ;
41
41
42
42
impl < ' a , N : NetworkListener + ' a > Iterator for NetworkConnections < ' a , N > {
@@ -46,7 +46,7 @@ impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> {
46
46
}
47
47
}
48
48
49
- /// An abstraction over streams that a Server can utilize.
49
+ /// An abstraction over streams that a ` Server` can utilize.
50
50
pub trait NetworkStream : Read + Write + Any + Send + Typeable {
51
51
/// Get the remote address of the underlying connection.
52
52
fn peer_addr ( & mut self ) -> io:: Result < SocketAddr > ;
@@ -76,7 +76,7 @@ pub trait NetworkStream: Read + Write + Any + Send + Typeable {
76
76
77
77
/// A connector creates a NetworkStream.
78
78
pub trait NetworkConnector {
79
- /// Type of Stream to create
79
+ /// Type of ` Stream` to create
80
80
type Stream : Into < Box < NetworkStream + Send > > ;
81
81
82
82
/// Connect to a remote address.
@@ -111,13 +111,13 @@ impl NetworkStream {
111
111
}
112
112
113
113
impl NetworkStream {
114
- /// Is the underlying type in this trait object a T ?
114
+ /// Is the underlying type in this trait object a `T` ?
115
115
#[ inline]
116
116
pub fn is < T : Any > ( & self ) -> bool {
117
117
( * self ) . get_type ( ) == TypeId :: of :: < T > ( )
118
118
}
119
119
120
- /// If the underlying type is T , get a reference to the contained data.
120
+ /// If the underlying type is `T` , get a reference to the contained data.
121
121
#[ inline]
122
122
pub fn downcast_ref < T : Any > ( & self ) -> Option < & T > {
123
123
if self . is :: < T > ( ) {
@@ -127,7 +127,7 @@ impl NetworkStream {
127
127
}
128
128
}
129
129
130
- /// If the underlying type is T , get a mutable reference to the contained
130
+ /// If the underlying type is `T` , get a mutable reference to the contained
131
131
/// data.
132
132
#[ inline]
133
133
pub fn downcast_mut < T : Any > ( & mut self ) -> Option < & mut T > {
@@ -138,7 +138,7 @@ impl NetworkStream {
138
138
}
139
139
}
140
140
141
- /// If the underlying type is T , extract it.
141
+ /// If the underlying type is `T` , extract it.
142
142
#[ inline]
143
143
pub fn downcast < T : Any > ( self : Box < NetworkStream > )
144
144
-> Result < Box < T > , Box < NetworkStream > > {
@@ -166,13 +166,13 @@ impl NetworkStream + Send {
166
166
}
167
167
168
168
impl NetworkStream + Send {
169
- /// Is the underlying type in this trait object a T ?
169
+ /// Is the underlying type in this trait object a `T` ?
170
170
#[ inline]
171
171
pub fn is < T : Any > ( & self ) -> bool {
172
172
( * self ) . get_type ( ) == TypeId :: of :: < T > ( )
173
173
}
174
174
175
- /// If the underlying type is T , get a reference to the contained data.
175
+ /// If the underlying type is `T` , get a reference to the contained data.
176
176
#[ inline]
177
177
pub fn downcast_ref < T : Any > ( & self ) -> Option < & T > {
178
178
if self . is :: < T > ( ) {
@@ -182,7 +182,7 @@ impl NetworkStream + Send {
182
182
}
183
183
}
184
184
185
- /// If the underlying type is T , get a mutable reference to the contained
185
+ /// If the underlying type is `T` , get a mutable reference to the contained
186
186
/// data.
187
187
#[ inline]
188
188
pub fn downcast_mut < T : Any > ( & mut self ) -> Option < & mut T > {
@@ -193,7 +193,7 @@ impl NetworkStream + Send {
193
193
}
194
194
}
195
195
196
- /// If the underlying type is T , extract it.
196
+ /// If the underlying type is `T` , extract it.
197
197
#[ inline]
198
198
pub fn downcast < T : Any > ( self : Box < NetworkStream + Send > )
199
199
-> Result < Box < T > , Box < NetworkStream + Send > > {
@@ -270,7 +270,7 @@ impl ::std::os::unix::io::FromRawFd for HttpListener {
270
270
}
271
271
}
272
272
273
- /// A wrapper around a TcpStream.
273
+ /// A wrapper around a ` TcpStream` .
274
274
pub struct HttpStream ( pub TcpStream ) ;
275
275
276
276
impl Clone for HttpStream {
@@ -381,7 +381,7 @@ impl NetworkConnector for HttpConnector {
381
381
}
382
382
}
383
383
384
- /// A closure as a connector used to generate TcpStreams per request
384
+ /// A closure as a connector used to generate `TcpStream`s per request
385
385
///
386
386
/// # Example
387
387
///
@@ -393,7 +393,7 @@ impl NetworkConnector for HttpConnector {
393
393
/// });
394
394
/// ```
395
395
///
396
- /// Example using TcpBuilder from the net2 crate if you want to configure your source socket:
396
+ /// Example using ` TcpBuilder` from the net2 crate if you want to configure your source socket:
397
397
///
398
398
/// ```norun
399
399
/// Client::with_connector(|addr: &str, port: u16, scheme: &str| {
0 commit comments