Skip to content

Commit b1cc137

Browse files
authored
Merge pull request #7 from async-rs/refs
feat(client): implement get_ref and get_mut for TlsStream
2 parents ae4a878 + 04d43a0 commit b1cc137

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/client.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ pub(crate) enum MidHandshake<IO> {
2828
End,
2929
}
3030

31+
impl<IO> TlsStream<IO> {
32+
/// Returns a reference to the underlying IO stream.
33+
pub fn get_ref(&self) -> &IO {
34+
&self.io
35+
}
36+
37+
/// Returns a mutuable reference to the underlying IO stream.
38+
pub fn get_mut(&mut self) -> &mut IO {
39+
&mut self.io
40+
}
41+
}
42+
3143
impl<IO> Future for MidHandshake<IO>
3244
where
3345
IO: AsyncRead + AsyncWrite + Unpin,

src/connector.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ use webpki::DNSNameRef;
2525
/// ## Example
2626
///
2727
/// ```rust
28-
/// #![feature(async_await)]
29-
///
3028
/// use async_tls::TlsConnector;
3129
///
3230
/// async_std::task::block_on(async {

0 commit comments

Comments
 (0)