web_sys/features/
gen_MemoryMeasurement.rs1#![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 = MemoryMeasurement)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `MemoryMeasurement` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"]
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 MemoryMeasurement;
17 #[cfg(web_sys_unstable_apis)]
18 #[cfg(feature = "MemoryBreakdownEntry")]
19 #[doc = "Get the `breakdown` field of this object."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`, `MemoryMeasurement`*"]
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 = "breakdown")]
26 pub fn get_breakdown(this: &MemoryMeasurement)
27 -> Option<::js_sys::Array<MemoryBreakdownEntry>>;
28 #[cfg(web_sys_unstable_apis)]
29 #[cfg(feature = "MemoryBreakdownEntry")]
30 #[doc = "Change the `breakdown` field of this object."]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `MemoryBreakdownEntry`, `MemoryMeasurement`*"]
33 #[doc = ""]
34 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
35 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
36 #[wasm_bindgen(method, setter = "breakdown")]
37 pub fn set_breakdown(this: &MemoryMeasurement, val: &[MemoryBreakdownEntry]);
38 #[cfg(web_sys_unstable_apis)]
39 #[doc = "Get the `bytes` field of this object."]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"]
42 #[doc = ""]
43 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
44 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
45 #[wasm_bindgen(method, getter = "bytes")]
46 pub fn get_bytes(this: &MemoryMeasurement) -> Option<f64>;
47 #[cfg(web_sys_unstable_apis)]
48 #[doc = "Change the `bytes` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"]
51 #[doc = ""]
52 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
53 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
54 #[wasm_bindgen(method, setter = "bytes")]
55 pub fn set_bytes(this: &MemoryMeasurement, val: u32);
56 #[cfg(web_sys_unstable_apis)]
57 #[doc = "Change the `bytes` field of this object."]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"]
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://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
63 #[wasm_bindgen(method, setter = "bytes")]
64 pub fn set_bytes_f64(this: &MemoryMeasurement, val: f64);
65}
66#[cfg(web_sys_unstable_apis)]
67impl MemoryMeasurement {
68 #[doc = "Construct a new `MemoryMeasurement`."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `MemoryMeasurement`*"]
71 #[doc = ""]
72 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
73 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
74 pub fn new() -> Self {
75 #[allow(unused_mut)]
76 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
77 ret
78 }
79 #[cfg(web_sys_unstable_apis)]
80 #[cfg(feature = "MemoryBreakdownEntry")]
81 #[deprecated = "Use `set_breakdown()` instead."]
82 pub fn breakdown(&mut self, val: &[MemoryBreakdownEntry]) -> &mut Self {
83 self.set_breakdown(val);
84 self
85 }
86 #[cfg(web_sys_unstable_apis)]
87 #[deprecated = "Use `set_bytes()` instead."]
88 pub fn bytes(&mut self, val: u32) -> &mut Self {
89 self.set_bytes(val);
90 self
91 }
92}
93#[cfg(web_sys_unstable_apis)]
94impl Default for MemoryMeasurement {
95 fn default() -> Self {
96 Self::new()
97 }
98}