diff --git a/tokio-xmpp/src/xmlstream/common.rs b/tokio-xmpp/src/xmlstream/common.rs index a30286b3fd8d0e73a649aa2b56404d45e9336bea..c560ab375195831597795db91bf5f2b053e289ec 100644 --- a/tokio-xmpp/src/xmlstream/common.rs +++ b/tokio-xmpp/src/xmlstream/common.rs @@ -133,6 +133,10 @@ impl RawXmlStream { fn parser_pinned(self: Pin<&mut Self>) -> &mut rxml::Parser { self.project().parser.parser_pinned() } + + pub(super) fn get_stream(&self) -> &Io { + self.parser.inner() + } } impl Stream for RawXmlStream { diff --git a/tokio-xmpp/src/xmlstream/mod.rs b/tokio-xmpp/src/xmlstream/mod.rs index b14915cefc7cca669480a09efbee169f41665d56..9a005ed2387843a4c98677316561a8c7b0f34162 100644 --- a/tokio-xmpp/src/xmlstream/mod.rs +++ b/tokio-xmpp/src/xmlstream/mod.rs @@ -161,6 +161,13 @@ pin_project_lite::pin_project! { } } +impl XmlStream { + /// Obtain a reference to the `Io` stream. + pub fn get_stream(&self) -> &Io { + self.inner.get_stream() + } +} + impl XmlStream { fn wrap(inner: RawXmlStream) -> Self { Self {