Skip to main content

CtxExtension

Trait CtxExtension 

Source
pub trait CtxExtension<'js> {
    // Required methods
    fn spawn_exit<F, R>(&self, future: F) -> Result<Receiver<R>>
       where F: Future<Output = Result<R>> + 'js,
             R: 'js;
    fn spawn_exit_simple<F>(&self, future: F)
       where F: Future<Output = Result<()>> + 'js;
}

Required Methods§

Source

fn spawn_exit<F, R>(&self, future: F) -> Result<Receiver<R>>
where F: Future<Output = Result<R>> + 'js, R: 'js,

Despite naming, this will not necessarily exit the parent process. It depends on the handler set by set_spawn_error_handler.

Source

fn spawn_exit_simple<F>(&self, future: F)
where F: Future<Output = Result<()>> + 'js,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'js> CtxExtension<'js> for Ctx<'js>

Source§

fn spawn_exit_simple<F>(&self, future: F)
where F: Future<Output = Result<()>> + 'js,

Same as above but fire & forget and without a forced stack trace collection

Source§

fn spawn_exit<F, R>(&self, future: F) -> Result<Receiver<R>>
where F: Future<Output = Result<R>> + 'js, R: 'js,

Implementors§