worker_plus_sys/
schedule.rs

1use wasm_bindgen::prelude::*;
2
3#[wasm_bindgen]
4extern "C" {
5    #[wasm_bindgen(extends=::js_sys::Object, js_name=ScheduledEvent)]
6    #[derive(Debug, Clone, PartialEq, Eq)]
7    pub type ScheduledEvent;
8
9    #[wasm_bindgen(structural, method, getter, js_class=ScheduledEvent, js_name=scheduledTime)]
10    pub fn scheduled_time(this: &ScheduledEvent) -> f64;
11
12    #[wasm_bindgen(structural, method, getter, js_class=ScheduledEvent, js_name=cron)]
13    pub fn cron(this: &ScheduledEvent) -> String;
14}
15
16/// [Context](https://developers.cloudflare.com/workers/runtime-apis/scheduled-event#syntax-module-worker)
17#[wasm_bindgen]
18extern "C" {
19    #[wasm_bindgen(extends=::js_sys::Object, js_name=ScheduleContext)]
20    #[derive(Debug, Clone)]
21    pub type ScheduleContext;
22
23    #[wasm_bindgen(structural, method, js_class=ScheduleContext, js_name=waitUntil)]
24    pub fn wait_until(this: &ScheduleContext, promise: js_sys::Promise);
25}