diff --git a/tokio-xmpp/src/xmlstream/common.rs b/tokio-xmpp/src/xmlstream/common.rs index a30286b3..c560ab37 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 b14915ce..9a005ed2 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 {