web_sys/features/
gen_MemoryAttribution.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 = MemoryAttribution)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `MemoryAttribution` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type MemoryAttribution;
17 #[cfg(web_sys_unstable_apis)]
18 #[cfg(feature = "MemoryAttributionContainer")]
19 #[doc = "Get the `container` field of this object."]
20 #[doc = ""]
21 #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`, `MemoryAttributionContainer`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25 #[wasm_bindgen(method, getter = "container")]
26 pub fn get_container(this: &MemoryAttribution) -> Option<MemoryAttributionContainer>;
27 #[cfg(web_sys_unstable_apis)]
28 #[cfg(feature = "MemoryAttributionContainer")]
29 #[doc = "Change the `container` field of this object."]
30 #[doc = ""]
31 #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`, `MemoryAttributionContainer`*"]
32 #[doc = ""]
33 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35 #[wasm_bindgen(method, setter = "container")]
36 pub fn set_container(this: &MemoryAttribution, val: &MemoryAttributionContainer);
37 #[cfg(web_sys_unstable_apis)]
38 #[doc = "Get the `scope` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"]
41 #[doc = ""]
42 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
44 #[wasm_bindgen(method, getter = "scope")]
45 pub fn get_scope(this: &MemoryAttribution) -> Option<::alloc::string::String>;
46 #[cfg(web_sys_unstable_apis)]
47 #[doc = "Change the `scope` field of this object."]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"]
50 #[doc = ""]
51 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53 #[wasm_bindgen(method, setter = "scope")]
54 pub fn set_scope(this: &MemoryAttribution, val: &str);
55 #[cfg(web_sys_unstable_apis)]
56 #[doc = "Get the `url` field of this object."]
57 #[doc = ""]
58 #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"]
59 #[doc = ""]
60 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
61 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
62 #[wasm_bindgen(method, getter = "url")]
63 pub fn get_url(this: &MemoryAttribution) -> Option<::alloc::string::String>;
64 #[cfg(web_sys_unstable_apis)]
65 #[doc = "Change the `url` field of this object."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"]
68 #[doc = ""]
69 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
70 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
71 #[wasm_bindgen(method, setter = "url")]
72 pub fn set_url(this: &MemoryAttribution, val: &str);
73}
74#[cfg(web_sys_unstable_apis)]
75impl MemoryAttribution {
76 #[doc = "Construct a new `MemoryAttribution`."]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"]
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://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
82 pub fn new() -> Self {
83 #[allow(unused_mut)]
84 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
85 ret
86 }
87 #[cfg(web_sys_unstable_apis)]
88 #[cfg(feature = "MemoryAttributionContainer")]
89 #[deprecated = "Use `set_container()` instead."]
90 pub fn container(&mut self, val: &MemoryAttributionContainer) -> &mut Self {
91 self.set_container(val);
92 self
93 }
94 #[cfg(web_sys_unstable_apis)]
95 #[deprecated = "Use `set_scope()` instead."]
96 pub fn scope(&mut self, val: &str) -> &mut Self {
97 self.set_scope(val);
98 self
99 }
100 #[cfg(web_sys_unstable_apis)]
101 #[deprecated = "Use `set_url()` instead."]
102 pub fn url(&mut self, val: &str) -> &mut Self {
103 self.set_url(val);
104 self
105 }
106}
107#[cfg(web_sys_unstable_apis)]
108impl Default for MemoryAttribution {
109 fn default() -> Self {
110 Self::new()
111 }
112}