Skip to main content

web_sys/features/
gen_MemoryBreakdownEntry.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 = MemoryBreakdownEntry)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `MemoryBreakdownEntry` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type MemoryBreakdownEntry;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "MemoryAttribution")]
19    #[doc = "Get the `attribution` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`, `MemoryBreakdownEntry`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    #[wasm_bindgen(method, getter = "attribution")]
26    pub fn get_attribution(
27        this: &MemoryBreakdownEntry,
28    ) -> Option<::js_sys::Array<MemoryAttribution>>;
29    #[cfg(web_sys_unstable_apis)]
30    #[cfg(feature = "MemoryAttribution")]
31    #[doc = "Change the `attribution` field of this object."]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`, `MemoryBreakdownEntry`*"]
34    #[doc = ""]
35    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
36    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
37    #[wasm_bindgen(method, setter = "attribution")]
38    pub fn set_attribution(this: &MemoryBreakdownEntry, val: &[MemoryAttribution]);
39    #[cfg(web_sys_unstable_apis)]
40    #[doc = "Get the `bytes` field of this object."]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"]
43    #[doc = ""]
44    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
45    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
46    #[wasm_bindgen(method, getter = "bytes")]
47    pub fn get_bytes(this: &MemoryBreakdownEntry) -> Option<f64>;
48    #[cfg(web_sys_unstable_apis)]
49    #[doc = "Change the `bytes` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"]
52    #[doc = ""]
53    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
55    #[wasm_bindgen(method, setter = "bytes")]
56    pub fn set_bytes(this: &MemoryBreakdownEntry, val: u32);
57    #[cfg(web_sys_unstable_apis)]
58    #[doc = "Change the `bytes` field of this object."]
59    #[doc = ""]
60    #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"]
61    #[doc = ""]
62    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
63    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
64    #[wasm_bindgen(method, setter = "bytes")]
65    pub fn set_bytes_f64(this: &MemoryBreakdownEntry, val: f64);
66    #[cfg(web_sys_unstable_apis)]
67    #[doc = "Get the `types` field of this object."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
73    #[wasm_bindgen(method, getter = "types")]
74    pub fn get_types(this: &MemoryBreakdownEntry) -> Option<::js_sys::Array<::js_sys::JsString>>;
75    #[cfg(web_sys_unstable_apis)]
76    #[doc = "Change the `types` field of this object."]
77    #[doc = ""]
78    #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
82    #[wasm_bindgen(method, setter = "types")]
83    pub fn set_types(this: &MemoryBreakdownEntry, val: &[::js_sys::JsString]);
84}
85#[cfg(web_sys_unstable_apis)]
86impl MemoryBreakdownEntry {
87    #[doc = "Construct a new `MemoryBreakdownEntry`."]
88    #[doc = ""]
89    #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`*"]
90    #[doc = ""]
91    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
92    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
93    pub fn new() -> Self {
94        #[allow(unused_mut)]
95        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
96        ret
97    }
98    #[cfg(web_sys_unstable_apis)]
99    #[cfg(feature = "MemoryAttribution")]
100    #[deprecated = "Use `set_attribution()` instead."]
101    pub fn attribution(&mut self, val: &[MemoryAttribution]) -> &mut Self {
102        self.set_attribution(val);
103        self
104    }
105    #[cfg(web_sys_unstable_apis)]
106    #[deprecated = "Use `set_bytes()` instead."]
107    pub fn bytes(&mut self, val: u32) -> &mut Self {
108        self.set_bytes(val);
109        self
110    }
111    #[cfg(web_sys_unstable_apis)]
112    #[deprecated = "Use `set_types()` instead."]
113    pub fn types(&mut self, val: &[::js_sys::JsString]) -> &mut Self {
114        self.set_types(val);
115        self
116    }
117}
118#[cfg(web_sys_unstable_apis)]
119impl Default for MemoryBreakdownEntry {
120    fn default() -> Self {
121        Self::new()
122    }
123}