pub fn local_addr(self) -> impl Future<Item = (Self, SocketAddr), Error = Error> {
        match self.listener {
            Listener::Listening(_, addr) => Either::A(futures::finished((self, addr))),
            Listener::Binding(_) => {
                let future = loop_fn(self, |mut this| {
                    if fibers::fiber::with_current_context(|_| ()).is_none() {
                        return Ok(Loop::Continue(this));
                    }

                    track!(this.listener.poll())?;
                    if let Listener::Listening(_, addr) = this.listener {
                        Ok(Loop::Break((this, addr)))
                    } else {
                        Ok(Loop::Continue(this))
                    }
                });
                Either::B(future)
            }
        }
    }
/// Returns a future that retrieves the address to which the server is bound.
Returns a future that retrieves the address to which the server is bound.
Returns a future that retrieves the address to which the server is bound .
pub fn local_addr(self) -> impl Future<Item = (Self, SocketAddr), Error = Error> {
        match self.listener {
            Listener::Listening(_, addr) => Either::A(futures::finished((self, addr))),
            Listener::Binding(_) => {
                let future = loop_fn(self, |mut this| {
                    if fibers::fiber::with_current_context(|_| ()).is_none() {
                        return Ok(Loop::Continue(this));
                    }
                    track!(this.listener.poll())?;
                    if let Listener::Listening(_, addr) = this.listener {
                        Ok(Loop::Break((this, addr)))
                    } else {
                        Ok(Loop::Continue(this))
                    }
                });
                Either::B(future)
            }
        }
    }
pub fn local_addr ( self ) -> impl Future < Item = ( Self , SocketAddr ) , Error = Error > { match self . listener { Listener :: Listening ( _ , addr ) => Either :: A ( futures :: finished ( ( self , addr ) ) ) , Listener :: Binding ( _ ) => { let future = loop_fn ( self , | mut this | { if fibers :: fiber :: with_current_context ( | _ | ( ) ) . is_none ( ) { return Ok ( Loop :: Continue ( this ) ) ; } track ! ( this listener poll ( ) ) ? ; if let Listener :: Listening ( _ , addr ) = this . listener { Ok ( Loop :: Break ( ( this , addr ) ) ) } else { Ok ( Loop :: Continue ( this ) ) } } ) ; Either :: B ( future ) } } }
Returns a future that retrieves the address to which the server is bound.
Returns a future that retrieves the address to which the server is bound .
self
self