fn poll_result(&mut self, waker: Option<&Waker>) -> Poll<Result<T, RecvError>> {
        if let Some(channel) = self.channel.take() {
            if let Poll::Ready((result, dropped)) = unsafe { channel.to_ref() }.read(waker, false) {
                // FIXME - automatically close channel via successful read()
                if dropped || unsafe { channel.to_ref().drop_one_side(false) } {
                    unsafe { channel.dealloc() };
                }
                Poll::Ready(result.ok_or(RecvError::Incomplete))
            } else {
                // sender has not dropped or produced a value
                self.channel.replace(channel);
                Poll::Pending
            }
        } else {
            Poll::Ready(Err(RecvError::Terminated))
        }
    }
// poll for the result (internal)
poll for the result (internal)
poll for the result ( internal )
fn poll_result(&mut self, waker: Option<&Waker>) -> Poll<Result<T, RecvError>> {
        if let Some(channel) = self.channel.take() {
            if let Poll::Ready((result, dropped)) = unsafe { channel.to_ref() }.read(waker, false) {
                // FIXME - automatically close channel via successful read()
                if dropped || unsafe { channel.to_ref().drop_one_side(false) } {
                    unsafe { channel.dealloc() };
                }
                Poll::Ready(result.ok_or(RecvError::Incomplete))
            } else {
                // sender has not dropped or produced a value
                self.channel.replace(channel);
                Poll::Pending
            }
        } else {
            Poll::Ready(Err(RecvError::Terminated))
        }
    }
fn poll_result ( & mut self , waker : Option < & Waker > ) -> Poll < Result < T , RecvError > > { if let Some ( channel ) = self . channel . take ( ) { if let Poll :: Ready ( ( result , dropped ) ) = unsafe { channel . to_ref ( ) } . read ( waker , false ) { // FIXME - automatically close channel via successful read() if dropped || unsafe { channel . to_ref ( ) . drop_one_side ( false ) } { unsafe { channel . dealloc ( ) } ; } Poll :: Ready ( result . ok_or ( RecvError :: Incomplete ) ) } else { // sender has not dropped or produced a value self . channel . replace ( channel ) ; Poll :: Pending } } else { Poll :: Ready ( Err ( RecvError :: Terminated ) ) } }
poll for the result (internal)
poll for the result ( internal )
&mut self
waker
Option<&Waker>
&mut self
waker
Option<&Waker>