web_sys/features/
gen_LockOptions.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = LockOptions)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `LockOptions` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type LockOptions;
17    #[cfg(web_sys_unstable_apis)]
18    #[doc = "Get the `ifAvailable` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"]
21    #[doc = ""]
22    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24    #[wasm_bindgen(method, getter = "ifAvailable")]
25    pub fn get_if_available(this: &LockOptions) -> Option<bool>;
26    #[cfg(web_sys_unstable_apis)]
27    #[doc = "Change the `ifAvailable` field of this object."]
28    #[doc = ""]
29    #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"]
30    #[doc = ""]
31    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33    #[wasm_bindgen(method, setter = "ifAvailable")]
34    pub fn set_if_available(this: &LockOptions, val: bool);
35    #[cfg(web_sys_unstable_apis)]
36    #[cfg(feature = "LockMode")]
37    #[doc = "Get the `mode` field of this object."]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `LockMode`, `LockOptions`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    #[wasm_bindgen(method, getter = "mode")]
44    pub fn get_mode(this: &LockOptions) -> Option<LockMode>;
45    #[cfg(web_sys_unstable_apis)]
46    #[cfg(feature = "LockMode")]
47    #[doc = "Change the `mode` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `LockMode`, `LockOptions`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "mode")]
54    pub fn set_mode(this: &LockOptions, val: LockMode);
55    #[cfg(web_sys_unstable_apis)]
56    #[cfg(feature = "AbortSignal")]
57    #[doc = "Get the `signal` field of this object."]
58    #[doc = ""]
59    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `LockOptions`*"]
60    #[doc = ""]
61    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
63    #[wasm_bindgen(method, getter = "signal")]
64    pub fn get_signal(this: &LockOptions) -> Option<AbortSignal>;
65    #[cfg(web_sys_unstable_apis)]
66    #[cfg(feature = "AbortSignal")]
67    #[doc = "Change the `signal` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `LockOptions`*"]
70    #[doc = ""]
71    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
72    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
73    #[wasm_bindgen(method, setter = "signal")]
74    pub fn set_signal(this: &LockOptions, val: &AbortSignal);
75    #[cfg(web_sys_unstable_apis)]
76    #[doc = "Get the `steal` field of this object."]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"]
79    #[doc = ""]
80    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
81    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
82    #[wasm_bindgen(method, getter = "steal")]
83    pub fn get_steal(this: &LockOptions) -> Option<bool>;
84    #[cfg(web_sys_unstable_apis)]
85    #[doc = "Change the `steal` field of this object."]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"]
88    #[doc = ""]
89    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
90    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
91    #[wasm_bindgen(method, setter = "steal")]
92    pub fn set_steal(this: &LockOptions, val: bool);
93}
94#[cfg(web_sys_unstable_apis)]
95impl LockOptions {
96    #[doc = "Construct a new `LockOptions`."]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `LockOptions`*"]
99    #[doc = ""]
100    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
101    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
102    pub fn new() -> Self {
103        #[allow(unused_mut)]
104        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
105        ret
106    }
107    #[cfg(web_sys_unstable_apis)]
108    #[deprecated = "Use `set_if_available()` instead."]
109    pub fn if_available(&mut self, val: bool) -> &mut Self {
110        self.set_if_available(val);
111        self
112    }
113    #[cfg(web_sys_unstable_apis)]
114    #[cfg(feature = "LockMode")]
115    #[deprecated = "Use `set_mode()` instead."]
116    pub fn mode(&mut self, val: LockMode) -> &mut Self {
117        self.set_mode(val);
118        self
119    }
120    #[cfg(web_sys_unstable_apis)]
121    #[cfg(feature = "AbortSignal")]
122    #[deprecated = "Use `set_signal()` instead."]
123    pub fn signal(&mut self, val: &AbortSignal) -> &mut Self {
124        self.set_signal(val);
125        self
126    }
127    #[cfg(web_sys_unstable_apis)]
128    #[deprecated = "Use `set_steal()` instead."]
129    pub fn steal(&mut self, val: bool) -> &mut Self {
130        self.set_steal(val);
131        self
132    }
133}
134#[cfg(web_sys_unstable_apis)]
135impl Default for LockOptions {
136    fn default() -> Self {
137        Self::new()
138    }
139}