|
| 1 | +#![allow(unused_imports)] |
| 2 | +use super::*; |
| 3 | +use wasm_bindgen::prelude::*; |
| 4 | +#[cfg(web_sys_unstable_apis)] |
| 5 | +#[wasm_bindgen] |
| 6 | +extern "C" { |
| 7 | + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = MemoryAttribution)] |
| 8 | + #[derive(Debug, Clone, PartialEq, Eq)] |
| 9 | + #[doc = "The `MemoryAttribution` dictionary."] |
| 10 | + #[doc = ""] |
| 11 | + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] |
| 12 | + #[doc = ""] |
| 13 | + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] |
| 14 | + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] |
| 15 | + pub type MemoryAttribution; |
| 16 | +} |
| 17 | +#[cfg(web_sys_unstable_apis)] |
| 18 | +impl MemoryAttribution { |
| 19 | + #[doc = "Construct a new `MemoryAttribution`."] |
| 20 | + #[doc = ""] |
| 21 | + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] |
| 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 | + pub fn new() -> Self { |
| 26 | + #[allow(unused_mut)] |
| 27 | + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); |
| 28 | + ret |
| 29 | + } |
| 30 | + #[cfg(web_sys_unstable_apis)] |
| 31 | + #[cfg(feature = "MemoryAttributionContainer")] |
| 32 | + #[doc = "Change the `container` field of this object."] |
| 33 | + #[doc = ""] |
| 34 | + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`, `MemoryAttributionContainer`*"] |
| 35 | + #[doc = ""] |
| 36 | + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] |
| 37 | + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] |
| 38 | + pub fn container(&mut self, val: &MemoryAttributionContainer) -> &mut Self { |
| 39 | + use wasm_bindgen::JsValue; |
| 40 | + let r = ::js_sys::Reflect::set( |
| 41 | + self.as_ref(), |
| 42 | + &JsValue::from("container"), |
| 43 | + &JsValue::from(val), |
| 44 | + ); |
| 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 | + #[cfg(web_sys_unstable_apis)] |
| 53 | + #[doc = "Change the `scope` field of this object."] |
| 54 | + #[doc = ""] |
| 55 | + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] |
| 56 | + #[doc = ""] |
| 57 | + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] |
| 58 | + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] |
| 59 | + pub fn scope(&mut self, val: &str) -> &mut Self { |
| 60 | + use wasm_bindgen::JsValue; |
| 61 | + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("scope"), &JsValue::from(val)); |
| 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(web_sys_unstable_apis)] |
| 70 | + #[doc = "Change the `url` field of this object."] |
| 71 | + #[doc = ""] |
| 72 | + #[doc = "*This API requires the following crate features to be activated: `MemoryAttribution`*"] |
| 73 | + #[doc = ""] |
| 74 | + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] |
| 75 | + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] |
| 76 | + pub fn url(&mut self, val: &str) -> &mut Self { |
| 77 | + use wasm_bindgen::JsValue; |
| 78 | + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("url"), &JsValue::from(val)); |
| 79 | + debug_assert!( |
| 80 | + r.is_ok(), |
| 81 | + "setting properties should never fail on our dictionary objects" |
| 82 | + ); |
| 83 | + let _ = r; |
| 84 | + self |
| 85 | + } |
| 86 | +} |
| 87 | +#[cfg(web_sys_unstable_apis)] |
| 88 | +impl Default for MemoryAttribution { |
| 89 | + fn default() -> Self { |
| 90 | + Self::new() |
| 91 | + } |
| 92 | +} |
0 commit comments