fetchlet 0.1.0

Rust-hosted JavaScript functions and Fetch handlers with explicit host services
Documentation
1
2
3
4
5
6
7
8
9
use serde_json::Value;

/// Low-level engine execution. App supplies invocation and host-service ownership.
/// Instances are not necessarily Send; keep them on their owning worker thread.
#[allow(async_fn_in_trait)]
pub trait Instance {
    async fn call_json(&mut self, export: &str, args: &[Value]) -> anyhow::Result<Value>;
    fn is_reusable(&self) -> bool;
}