maxcountryman_web_sys/features/
gen_ConsoleInstanceOptions.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ConsoleInstanceOptions)]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `ConsoleInstanceOptions` dictionary."]
9 #[doc = ""]
10 #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"]
11 pub type ConsoleInstanceOptions;
12}
13impl ConsoleInstanceOptions {
14 #[doc = "Construct a new `ConsoleInstanceOptions`."]
15 #[doc = ""]
16 #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"]
17 pub fn new() -> Self {
18 #[allow(unused_mut)]
19 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20 ret
21 }
22 #[doc = "Change the `consoleID` field of this object."]
23 #[doc = ""]
24 #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"]
25 pub fn console_id(&mut self, val: &str) -> &mut Self {
26 use wasm_bindgen::JsValue;
27 let r = ::js_sys::Reflect::set(
28 self.as_ref(),
29 &JsValue::from("consoleID"),
30 &JsValue::from(val),
31 );
32 debug_assert!(
33 r.is_ok(),
34 "setting properties should never fail on our dictionary objects"
35 );
36 let _ = r;
37 self
38 }
39 #[doc = "Change the `dump` field of this object."]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"]
42 pub fn dump(&mut self, val: &::js_sys::Function) -> &mut Self {
43 use wasm_bindgen::JsValue;
44 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dump"), &JsValue::from(val));
45 debug_assert!(
46 r.is_ok(),
47 "setting properties should never fail on our dictionary objects"
48 );
49 let _ = r;
50 self
51 }
52 #[doc = "Change the `innerID` field of this object."]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"]
55 pub fn inner_id(&mut self, val: &str) -> &mut Self {
56 use wasm_bindgen::JsValue;
57 let r = ::js_sys::Reflect::set(
58 self.as_ref(),
59 &JsValue::from("innerID"),
60 &JsValue::from(val),
61 );
62 debug_assert!(
63 r.is_ok(),
64 "setting properties should never fail on our dictionary objects"
65 );
66 let _ = r;
67 self
68 }
69 #[cfg(feature = "ConsoleLogLevel")]
70 #[doc = "Change the `maxLogLevel` field of this object."]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`, `ConsoleLogLevel`*"]
73 pub fn max_log_level(&mut self, val: ConsoleLogLevel) -> &mut Self {
74 use wasm_bindgen::JsValue;
75 let r = ::js_sys::Reflect::set(
76 self.as_ref(),
77 &JsValue::from("maxLogLevel"),
78 &JsValue::from(val),
79 );
80 debug_assert!(
81 r.is_ok(),
82 "setting properties should never fail on our dictionary objects"
83 );
84 let _ = r;
85 self
86 }
87 #[doc = "Change the `maxLogLevelPref` field of this object."]
88 #[doc = ""]
89 #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"]
90 pub fn max_log_level_pref(&mut self, val: &str) -> &mut Self {
91 use wasm_bindgen::JsValue;
92 let r = ::js_sys::Reflect::set(
93 self.as_ref(),
94 &JsValue::from("maxLogLevelPref"),
95 &JsValue::from(val),
96 );
97 debug_assert!(
98 r.is_ok(),
99 "setting properties should never fail on our dictionary objects"
100 );
101 let _ = r;
102 self
103 }
104 #[doc = "Change the `prefix` field of this object."]
105 #[doc = ""]
106 #[doc = "*This API requires the following crate features to be activated: `ConsoleInstanceOptions`*"]
107 pub fn prefix(&mut self, val: &str) -> &mut Self {
108 use wasm_bindgen::JsValue;
109 let r =
110 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("prefix"), &JsValue::from(val));
111 debug_assert!(
112 r.is_ok(),
113 "setting properties should never fail on our dictionary objects"
114 );
115 let _ = r;
116 self
117 }
118}
119impl Default for ConsoleInstanceOptions {
120 fn default() -> Self {
121 Self::new()
122 }
123}