Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions futures-util/src/compat/compat01as03.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ impl<T> Compat01As03<T> {
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)
Expand Down Expand Up @@ -189,6 +194,11 @@ impl<S, SinkItem> Compat01As03Sink<S, SinkItem> {
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<S, SinkItem> Stream03 for Compat01As03Sink<S, SinkItem>
Expand Down