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-05-12 14:59:20 +09:00
|
|
|
fn compute(&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>>;
|
|
|
|
}
|