Skip to main content

NativeContinuation

Trait NativeContinuation 

Source
pub trait NativeContinuation: Trace {
    // Required method
    fn resume(
        self: Box<Self>,
        context: &mut NativeCallContext<'_>,
        input: ResumeInput,
    ) -> NativeResult;

    // Provided method
    fn is_trivial_spawn_handle(&self) -> bool { ... }
}

Required Methods§

Source

fn resume( self: Box<Self>, context: &mut NativeCallContext<'_>, input: ResumeInput, ) -> NativeResult

Provided Methods§

Source

fn is_trivial_spawn_handle(&self) -> bool

True ONLY for a RuntimeRequest::Spawn continuation whose entire behavior is mapping RuntimeResponse::Promise(id) to Value::async_promise_id(id)async/spawn’s own default. The spawn dispatcher’s parked-VM fast path inlines exactly that mapping and skips invoking the continuation; a continuation that leaves this false is routed through the general pending-stage path so its logic actually runs. Do not return true from a continuation that does anything else: the fast path would silently discard that behavior.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§