Skip to content

Commit 98de783

Browse files
vorot93cramertj
authored andcommitted
Add get_ref to Compat01As03 and Compat01As03Sink
1 parent 9f430fd commit 98de783

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

futures-util/src/compat/compat01as03.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ impl<T> Compat01As03<T> {
3737
let notify = &WakerToHandle(cx.waker());
3838
self.inner.poll_fn_notify(notify, 0, f)
3939
}
40+
41+
/// Get a reference to 0.1 Future, Stream, AsyncRead, or AsyncWrite object contained within.
42+
pub fn get_ref(&self) -> &T {
43+
self.inner.get_ref()
44+
}
4045
}
4146

4247
/// Extension trait for futures 0.1 [`Future`](futures::future::Future)
@@ -189,6 +194,11 @@ impl<S, SinkItem> Compat01As03Sink<S, SinkItem> {
189194
let notify = &WakerToHandle(cx.waker());
190195
self.inner.poll_fn_notify(notify, 0, f)
191196
}
197+
198+
/// Get a reference to 0.1 Sink object contained within.
199+
pub fn get_ref(&self) -> &S {
200+
self.inner.get_ref()
201+
}
192202
}
193203

194204
impl<S, SinkItem> Stream03 for Compat01As03Sink<S, SinkItem>

0 commit comments

Comments
 (0)