pub fn new<F>(stack: Stack, f: F) -> Result<Self, Error>
    where
        F: FnOnce(AsyncYielder<Output>) -> Output + 'a + Send,
    {
        let generator = Generator::new(stack, |yielder, waker| {
            let async_yielder = AsyncYielder::new(yielder, waker);
            let finished = Some(f(async_yielder));
            yielder.suspend(finished);
        });

        Ok(Self {
            generator: Some(Cell::new(generator)),
            pre_post_poll: None,
        })
    }
/// Returns a new AsyncWormhole, using the passed `stack` to execute the closure `f` on.
/// The closure will not be executed right away, only if you pass AsyncWormhole to an
/// async executor (.await on it)
Returns a new AsyncWormhole, using the passed `stack` to execute the closure `f` on.
The closure will not be executed right away, only if you pass AsyncWormhole to an
async executor (.await on it)
Returns a new AsyncWormhole using the passed ` stack ` to execute the closure ` f ` on . The closure will not be executed right away only if you pass AsyncWormhole to an async executor ( . await on it )
pub fn new<F>(stack: Stack, f: F) -> Result<Self, Error>
    where
        F: FnOnce(AsyncYielder<Output>) -> Output + 'a + Send,
    {
        let generator = Generator::new(stack, |yielder, waker| {
            let async_yielder = AsyncYielder::new(yielder, waker);
            let finished = Some(f(async_yielder));
            yielder.suspend(finished);
        });
        Ok(Self {
            generator: Some(Cell::new(generator)),
            pre_post_poll: None,
        })
    }
pub fn new < F > ( stack : Stack , f : F ) -> Result < Self , Error > where F : FnOnce ( AsyncYielder < Output > ) -> Output + ' a + Send , { let generator = Generator :: new ( stack , | yielder , waker | { let async_yielder = AsyncYielder :: new ( yielder , waker ) ; let finished = Some ( f ( async_yielder ) ) ; yielder . suspend ( finished ) ; } ) ; Ok ( Self { generator : Some ( Cell :: new ( generator ) ) , pre_post_poll : None , } ) }
Returns a new AsyncWormhole, using the passed `stack` to execute the closure `f` on.
Returns a new AsyncWormhole using the passed ` stack ` to execute the closure ` f ` on .
stack
Stack
f
F
stack
Stack
f
F