diff --git a/src/acceptor.rs b/src/acceptor.rs index e843be2..45cc09a 100644 --- a/src/acceptor.rs +++ b/src/acceptor.rs @@ -35,6 +35,13 @@ impl TlsStream { state: State::Handshaking(accept), } } + + pub fn stream_mut(&mut self) -> Option<(&mut AddrStream, &mut rustls::ServerConnection)> { + match &mut self.state { + State::Handshaking(_) => None, + State::Streaming(stream) => Some(stream.get_mut()), + } + } } impl AsyncRead for TlsStream {