[][src]Trait napi::Task

pub trait Task: Send + Sized {
    type Output: Send + Sized + 'static;
    type JsValue: NapiValue;
    pub fn compute(&mut self) -> Result<Self::Output>;
pub fn resolve(
        self,
        env: Env,
        output: Self::Output
    ) -> Result<Self::JsValue>; pub fn reject(self, _env: Env, err: Error) -> Result<Self::JsValue> { ... } }

Associated Types

Loading content...

Required methods

pub fn compute(&mut self) -> Result<Self::Output>[src]

Compute logic in libuv thread

pub fn resolve(self, env: Env, output: Self::Output) -> Result<Self::JsValue>[src]

Into this method if compute return Ok

Loading content...

Provided methods

pub fn reject(self, _env: Env, err: Error) -> Result<Self::JsValue>[src]

Into this method if compute return Err

Loading content...

Implementors

Loading content...