Skip to content

Commit 641a4a4

Browse files
feat(client): implement get_ref and get_mut for TlsStream
1 parent ae4a878 commit 641a4a4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
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,

0 commit comments

Comments
 (0)