worker_plus_sys/
fetcher.rs1use wasm_bindgen::prelude::*;
2
3use crate::{Request, RequestInit};
4
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(extends = ::js_sys::Object, js_name = Fetcher)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 pub type Fetcher;
10
11 #[wasm_bindgen(structural, method, js_class=Fetcher, js_name = fetch)]
12 pub fn fetch(this: &Fetcher, input: &Request) -> ::js_sys::Promise;
13 #[wasm_bindgen(structural, method, js_class=Fetcher, js_name = fetch)]
14 pub fn fetch_with_str(this: &Fetcher, input: &str) -> ::js_sys::Promise;
15 #[wasm_bindgen(structural, method, js_class=Fetcher, js_name = fetch)]
16 pub fn fetch_with_init(
17 this: &Fetcher,
18 input: &Request,
19 init: &RequestInit,
20 ) -> ::js_sys::Promise;
21 #[wasm_bindgen(structural, method, js_class=Fetcher, js_name = fetch)]
22 pub fn fetch_with_str_and_init(
23 this: &Fetcher,
24 input: &str,
25 init: &RequestInit,
26 ) -> ::js_sys::Promise;
27}