web_sys/features/
gen_SpeechRecognitionErrorInit.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = SpeechRecognitionErrorInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `SpeechRecognitionErrorInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
12    pub type SpeechRecognitionErrorInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &SpeechRecognitionErrorInit) -> Option<bool>;
18    #[doc = "Change the `bubbles` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &SpeechRecognitionErrorInit, val: bool);
23    #[doc = "Get the `cancelable` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &SpeechRecognitionErrorInit) -> Option<bool>;
28    #[doc = "Change the `cancelable` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &SpeechRecognitionErrorInit, val: bool);
33    #[doc = "Get the `composed` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &SpeechRecognitionErrorInit) -> Option<bool>;
38    #[doc = "Change the `composed` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &SpeechRecognitionErrorInit, val: bool);
43    #[cfg(feature = "SpeechRecognitionErrorCode")]
44    #[doc = "Get the `error` field of this object."]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorCode`, `SpeechRecognitionErrorInit`*"]
47    #[wasm_bindgen(method, getter = "error")]
48    pub fn get_error(this: &SpeechRecognitionErrorInit) -> Option<SpeechRecognitionErrorCode>;
49    #[cfg(feature = "SpeechRecognitionErrorCode")]
50    #[doc = "Change the `error` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorCode`, `SpeechRecognitionErrorInit`*"]
53    #[wasm_bindgen(method, setter = "error")]
54    pub fn set_error(this: &SpeechRecognitionErrorInit, val: SpeechRecognitionErrorCode);
55    #[doc = "Get the `message` field of this object."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
58    #[wasm_bindgen(method, getter = "message")]
59    pub fn get_message(this: &SpeechRecognitionErrorInit) -> Option<::alloc::string::String>;
60    #[doc = "Change the `message` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
63    #[wasm_bindgen(method, setter = "message")]
64    pub fn set_message(this: &SpeechRecognitionErrorInit, val: &str);
65}
66impl SpeechRecognitionErrorInit {
67    #[doc = "Construct a new `SpeechRecognitionErrorInit`."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `SpeechRecognitionErrorInit`*"]
70    pub fn new() -> Self {
71        #[allow(unused_mut)]
72        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
73        ret
74    }
75    #[deprecated = "Use `set_bubbles()` instead."]
76    pub fn bubbles(&mut self, val: bool) -> &mut Self {
77        self.set_bubbles(val);
78        self
79    }
80    #[deprecated = "Use `set_cancelable()` instead."]
81    pub fn cancelable(&mut self, val: bool) -> &mut Self {
82        self.set_cancelable(val);
83        self
84    }
85    #[deprecated = "Use `set_composed()` instead."]
86    pub fn composed(&mut self, val: bool) -> &mut Self {
87        self.set_composed(val);
88        self
89    }
90    #[cfg(feature = "SpeechRecognitionErrorCode")]
91    #[deprecated = "Use `set_error()` instead."]
92    pub fn error(&mut self, val: SpeechRecognitionErrorCode) -> &mut Self {
93        self.set_error(val);
94        self
95    }
96    #[deprecated = "Use `set_message()` instead."]
97    pub fn message(&mut self, val: &str) -> &mut Self {
98        self.set_message(val);
99        self
100    }
101}
102impl Default for SpeechRecognitionErrorInit {
103    fn default() -> Self {
104        Self::new()
105    }
106}