pub trait Task: Send + Sized {
type Output: Send + Sized + 'static;
type JsValue: ToNapiValue + TypeName;
// Required methods
fn compute(&mut self) -> Result<Self::Output>;
fn resolve(
&mut self,
env: Env,
output: Self::Output,
) -> Result<Self::JsValue>;
// Provided methods
fn reject(&mut self, env: Env, err: Error) -> Result<Self::JsValue> { ... }
fn finally(self, env: Env) -> Result<()> { ... }
}Required Associated Types§
Required Methods§
Provided Methods§
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.