Add listen_with fns.

This commit is contained in:
Tim Kuehn
2016-12-05 15:23:07 -08:00
parent 13e56481bb
commit 5c17ffacae
2 changed files with 40 additions and 7 deletions

View File

@@ -77,6 +77,13 @@ pub struct ListenFuture {
inner: futures::Oneshot<io::Result<SocketAddr>>,
}
impl ListenFuture {
#[doc(hidden)]
pub fn from_oneshot(rx: futures::Oneshot<io::Result<SocketAddr>>) -> Self {
ListenFuture { inner: rx }
}
}
impl Future for ListenFuture {
type Item = SocketAddr;
type Error = io::Error;