2020-05-11 01:28:06 +09:00
|
|
|
use crate::{Env, Result, Value, ValueType};
|
|
|
|
|
|
|
|
pub trait Task {
|
2020-05-12 14:59:20 +09:00
|
|
|
type Output: Send + Sized + 'static;
|
2020-05-11 01:28:06 +09:00
|
|
|
type JsValue: ValueType;
|
|
|
|
|
2020-06-19 17:19:06 +09:00
|
|
|
fn compute(&mut self) -> Result<Self::Output>;
|
2020-05-11 01:28:06 +09:00
|
|
|
|
|
|
|
fn resolve(&self, env: &mut Env, output: Self::Output) -> Result<Value<Self::JsValue>>;
|
|
|
|
}
|