MetastackExt

Trait MetastackExt 

Source
pub trait MetastackExt<'s>: Sized {
    type Output;

    // Required methods
    fn with_metastack_resume_point(
        self,
    ) -> Pin<Box<dyn Future<Output = Self::Output> + 's>>;
    fn run_sync_with_metastack(self) -> Self::Output;
}

Required Associated Types§

Required Methods§

Source

fn with_metastack_resume_point( self, ) -> Pin<Box<dyn Future<Output = Self::Output> + 's>>

Transforms a future into a future that will return Poll::Pending if there is not enough stack space to execute the future.

Source

fn run_sync_with_metastack(self) -> Self::Output

Sets up a landing pad to catch Poll::Pending returns and run the next scheduled future on a slightly emptier stack.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'s, F> MetastackExt<'s> for F
where F: Future + 's,