pub fn async_suspend<Fut, R>(&mut self, mut future: Fut) -> R
    where
        Fut: Future<Output = R>,
    {
        let mut future = unsafe { Pin::new_unchecked(&mut future) };
        loop {
            let mut cx = Context::from_waker(&mut self.waker);
            self.waker = match future.as_mut().poll(&mut cx) {
                Poll::Pending => self.yielder.suspend(None),
                Poll::Ready(result) => return result,
            };
        }
    }
/// Takes an `impl Future` and awaits it, returning the value from it once ready.
Takes an `impl Future` and awaits it, returning the value from it once ready.
Takes an ` impl Future ` and awaits it returning the value from it once ready .
pub fn async_suspend<Fut, R>(&mut self, mut future: Fut) -> R
    where
        Fut: Future<Output = R>,
    {
        let mut future = unsafe { Pin::new_unchecked(&mut future) };
        loop {
            let mut cx = Context::from_waker(&mut self.waker);
            self.waker = match future.as_mut().poll(&mut cx) {
                Poll::Pending => self.yielder.suspend(None),
                Poll::Ready(result) => return result,
            };
        }
    }
pub fn async_suspend < Fut , R > ( & mut self , mut future : Fut ) -> R where Fut : Future < Output = R > , { let mut future = unsafe { Pin :: new_unchecked ( & mut future ) } ; loop { let mut cx = Context :: from_waker ( & mut self . waker ) ; self . waker = match future . as_mut ( ) . poll ( & mut cx ) { Poll :: Pending => self . yielder . suspend ( None ) , Poll :: Ready ( result ) => return result , } ; } }
Takes an `impl Future` and awaits it, returning the value from it once ready.
Takes an ` impl Future ` and awaits it returning the value from it once ready .
&mut self
future
Fut
&mut self
future
Fut