maxcountryman_web_sys/features/
gen_CheckerboardReport.rs

1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CheckerboardReport)]
7    #[derive(Debug, Clone, PartialEq, Eq)]
8    #[doc = "The `CheckerboardReport` dictionary."]
9    #[doc = ""]
10    #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"]
11    pub type CheckerboardReport;
12}
13impl CheckerboardReport {
14    #[doc = "Construct a new `CheckerboardReport`."]
15    #[doc = ""]
16    #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"]
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 `log` field of this object."]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"]
25    pub fn log(&mut self, val: &str) -> &mut Self {
26        use wasm_bindgen::JsValue;
27        let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("log"), &JsValue::from(val));
28        debug_assert!(
29            r.is_ok(),
30            "setting properties should never fail on our dictionary objects"
31        );
32        let _ = r;
33        self
34    }
35    #[cfg(feature = "CheckerboardReason")]
36    #[doc = "Change the `reason` field of this object."]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `CheckerboardReason`, `CheckerboardReport`*"]
39    pub fn reason(&mut self, val: CheckerboardReason) -> &mut Self {
40        use wasm_bindgen::JsValue;
41        let r =
42            ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("reason"), &JsValue::from(val));
43        debug_assert!(
44            r.is_ok(),
45            "setting properties should never fail on our dictionary objects"
46        );
47        let _ = r;
48        self
49    }
50    #[doc = "Change the `severity` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"]
53    pub fn severity(&mut self, val: u32) -> &mut Self {
54        use wasm_bindgen::JsValue;
55        let r = ::js_sys::Reflect::set(
56            self.as_ref(),
57            &JsValue::from("severity"),
58            &JsValue::from(val),
59        );
60        debug_assert!(
61            r.is_ok(),
62            "setting properties should never fail on our dictionary objects"
63        );
64        let _ = r;
65        self
66    }
67    #[doc = "Change the `timestamp` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `CheckerboardReport`*"]
70    pub fn timestamp(&mut self, val: f64) -> &mut Self {
71        use wasm_bindgen::JsValue;
72        let r = ::js_sys::Reflect::set(
73            self.as_ref(),
74            &JsValue::from("timestamp"),
75            &JsValue::from(val),
76        );
77        debug_assert!(
78            r.is_ok(),
79            "setting properties should never fail on our dictionary objects"
80        );
81        let _ = r;
82        self
83    }
84}
85impl Default for CheckerboardReport {
86    fn default() -> Self {
87        Self::new()
88    }
89}