Add get_ref/get_mut for TlsStream (#37)

This commit is contained in:
quininer
2019-03-19 23:45:18 +08:00
committed by Sean McArthur
parent 99f1e38bcc
commit 287c26a7a1
+13
View File
@@ -128,6 +128,19 @@ impl<T> TlsStream<T> {
inner,
}
}
/// Get access to the internal `native_tls::TlsStream` stream which also
/// transitively allows access to `T`.
pub fn get_ref(&self) -> &native_tls::TlsStream<T> {
&self.inner
}
/// Get mutable access to the internal `native_tls::TlsStream` stream which
/// also transitively allows mutable access to `T`.
pub fn get_mut(&mut self) -> &mut native_tls::TlsStream<T> {
&mut self.inner
}
}
impl<T: fmt::Debug> fmt::Debug for TlsStream<T> {