web_sys/features/
gen_StorageEstimate.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = StorageEstimate)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `StorageEstimate` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
12 pub type StorageEstimate;
13 #[doc = "Get the `quota` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
16 #[wasm_bindgen(method, getter = "quota")]
17 pub fn get_quota(this: &StorageEstimate) -> Option<f64>;
18 #[doc = "Change the `quota` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
21 #[wasm_bindgen(method, setter = "quota")]
22 pub fn set_quota(this: &StorageEstimate, val: f64);
23 #[doc = "Change the `quota` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
26 #[wasm_bindgen(method, setter = "quota")]
27 pub fn set_quota_u32(this: &StorageEstimate, val: u32);
28 #[doc = "Change the `quota` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
31 #[wasm_bindgen(method, setter = "quota")]
32 pub fn set_quota_f64(this: &StorageEstimate, val: f64);
33 #[doc = "Get the `usage` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
36 #[wasm_bindgen(method, getter = "usage")]
37 pub fn get_usage(this: &StorageEstimate) -> Option<f64>;
38 #[doc = "Change the `usage` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
41 #[wasm_bindgen(method, setter = "usage")]
42 pub fn set_usage(this: &StorageEstimate, val: f64);
43 #[doc = "Change the `usage` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
46 #[wasm_bindgen(method, setter = "usage")]
47 pub fn set_usage_u32(this: &StorageEstimate, val: u32);
48 #[doc = "Change the `usage` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
51 #[wasm_bindgen(method, setter = "usage")]
52 pub fn set_usage_f64(this: &StorageEstimate, val: f64);
53}
54impl StorageEstimate {
55 #[doc = "Construct a new `StorageEstimate`."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `StorageEstimate`*"]
58 pub fn new() -> Self {
59 #[allow(unused_mut)]
60 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
61 ret
62 }
63 #[deprecated = "Use `set_quota()` instead."]
64 pub fn quota(&mut self, val: f64) -> &mut Self {
65 self.set_quota(val);
66 self
67 }
68 #[deprecated = "Use `set_usage()` instead."]
69 pub fn usage(&mut self, val: f64) -> &mut Self {
70 self.set_usage(val);
71 self
72 }
73}
74impl Default for StorageEstimate {
75 fn default() -> Self {
76 Self::new()
77 }
78}