mirror of https://github.com/ctz/rustls
stream: add socket accessors
The other TLS libraries all provide those methods on their stream implementations, this helps make things more similar Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
This commit is contained in:
parent
05b8915b3f
commit
94563739d3
|
@ -101,6 +101,16 @@ impl<S, T> StreamOwned<S, T> where S: Session, T: Read + Write {
|
|||
pub fn new(sess: S, sock: T) -> StreamOwned<S, T> {
|
||||
StreamOwned { sess, sock }
|
||||
}
|
||||
|
||||
/// Get a reference to the underlying socket
|
||||
pub fn get_ref(&self) -> &T {
|
||||
&self.sock
|
||||
}
|
||||
|
||||
/// Get a mutable reference to the underlying socket
|
||||
pub fn get_mut(&mut self) -> &T {
|
||||
&mut self.sock
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, S, T> StreamOwned<S, T> where S: Session, T: Read + Write {
|
||||
|
|
Loading…
Reference in New Issue