Skip to main content

web_sys/features/
gen_AbortSignal.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "EventTarget",
9        extends = "::js_sys::Object",
10        js_name = "AbortSignal",
11        typescript_type = "AbortSignal"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `AbortSignal` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
19    pub type AbortSignal;
20    #[wasm_bindgen(method, getter, js_class = "AbortSignal", js_name = "aborted")]
21    #[doc = "Getter for the `aborted` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/aborted)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
26    pub fn aborted(this: &AbortSignal) -> bool;
27    #[wasm_bindgen(method, getter, js_class = "AbortSignal", js_name = "reason")]
28    #[doc = "Getter for the `reason` field of this object."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/reason)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
33    pub fn reason(this: &AbortSignal) -> ::wasm_bindgen::JsValue;
34    #[wasm_bindgen(method, getter, js_class = "AbortSignal", js_name = "onabort")]
35    #[doc = "Getter for the `onabort` field of this object."]
36    #[doc = ""]
37    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/onabort)"]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
40    pub fn onabort(this: &AbortSignal) -> Option<::js_sys::Function>;
41    #[wasm_bindgen(method, setter, js_class = "AbortSignal", js_name = "onabort")]
42    #[doc = "Setter for the `onabort` field of this object."]
43    #[doc = ""]
44    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/onabort)"]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
47    pub fn set_onabort(this: &AbortSignal, value: Option<&::js_sys::Function>);
48    #[wasm_bindgen(static_method_of = "AbortSignal", js_class = "AbortSignal")]
49    #[doc = "The `abort()` method."]
50    #[doc = ""]
51    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/abort_static)"]
52    #[doc = ""]
53    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
54    pub fn abort() -> AbortSignal;
55    #[wasm_bindgen(
56        static_method_of = "AbortSignal",
57        js_class = "AbortSignal",
58        js_name = "abort"
59    )]
60    #[doc = "The `abort()` method."]
61    #[doc = ""]
62    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/abort_static)"]
63    #[doc = ""]
64    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
65    pub fn abort_with_reason(reason: &::wasm_bindgen::JsValue) -> AbortSignal;
66    #[wasm_bindgen(static_method_of = "AbortSignal", js_class = "AbortSignal")]
67    #[doc = "The `any()` method."]
68    #[doc = ""]
69    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static)"]
70    #[doc = ""]
71    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
72    pub fn any(signals: &::wasm_bindgen::JsValue) -> AbortSignal;
73    #[wasm_bindgen(method, js_class = "AbortSignal", js_name = "throwIfAborted")]
74    #[doc = "The `throwIfAborted()` method."]
75    #[doc = ""]
76    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted)"]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
79    pub fn throw_if_aborted(this: &AbortSignal);
80    #[wasm_bindgen(
81        static_method_of = "AbortSignal",
82        js_class = "AbortSignal",
83        js_name = "timeout"
84    )]
85    #[doc = "The `timeout()` method."]
86    #[doc = ""]
87    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static)"]
88    #[doc = ""]
89    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
90    pub fn timeout_with_u32(milliseconds: u32) -> AbortSignal;
91    #[wasm_bindgen(
92        static_method_of = "AbortSignal",
93        js_class = "AbortSignal",
94        js_name = "timeout"
95    )]
96    #[doc = "The `timeout()` method."]
97    #[doc = ""]
98    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout_static)"]
99    #[doc = ""]
100    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`*"]
101    pub fn timeout_with_f64(milliseconds: f64) -> AbortSignal;
102}