worker-sys 0.8.0

Low-level extern definitions / FFI bindings to the Cloudflare Workers JS Runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use wasm_bindgen::prelude::*;

#[wasm_bindgen]
extern "C" {
    #[wasm_bindgen(extends=js_sys::Object)]
    #[derive(Debug, PartialEq, Eq)]
    pub type Context;

    #[wasm_bindgen(method, catch, js_name=waitUntil)]
    pub fn wait_until(this: &Context, promise: &js_sys::Promise) -> Result<(), JsValue>;

    #[wasm_bindgen(method, catch, js_name=passThroughOnException)]
    pub fn pass_through_on_exception(this: &Context) -> Result<(), JsValue>;

    #[wasm_bindgen(method, getter)]
    pub fn props(this: &Context) -> JsValue;
}