diff --git a/futures-util/src/compat/compat01as03.rs b/futures-util/src/compat/compat01as03.rs index 36e6b5d27c..2debef8753 100644 --- a/futures-util/src/compat/compat01as03.rs +++ b/futures-util/src/compat/compat01as03.rs @@ -37,6 +37,11 @@ impl Compat01As03 { let notify = &WakerToHandle(cx.waker()); self.inner.poll_fn_notify(notify, 0, f) } + + /// Get a reference to 0.1 Future, Stream, AsyncRead, or AsyncWrite object contained within. + pub fn get_ref(&self) -> &T { + self.inner.get_ref() + } } /// Extension trait for futures 0.1 [`Future`](futures::future::Future) @@ -189,6 +194,11 @@ impl Compat01As03Sink { let notify = &WakerToHandle(cx.waker()); self.inner.poll_fn_notify(notify, 0, f) } + + /// Get a reference to 0.1 Sink object contained within. + pub fn get_ref(&self) -> &S { + self.inner.get_ref() + } } impl Stream03 for Compat01As03Sink