maxcountryman_web_sys/features/
gen_CacheBatchOperation.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CacheBatchOperation)]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `CacheBatchOperation` dictionary."]
9 #[doc = ""]
10 #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"]
11 pub type CacheBatchOperation;
12}
13impl CacheBatchOperation {
14 #[doc = "Construct a new `CacheBatchOperation`."]
15 #[doc = ""]
16 #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"]
17 pub fn new() -> Self {
18 #[allow(unused_mut)]
19 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20 ret
21 }
22 #[cfg(feature = "CacheQueryOptions")]
23 #[doc = "Change the `options` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `CacheQueryOptions`*"]
26 pub fn options(&mut self, val: &CacheQueryOptions) -> &mut Self {
27 use wasm_bindgen::JsValue;
28 let r = ::js_sys::Reflect::set(
29 self.as_ref(),
30 &JsValue::from("options"),
31 &JsValue::from(val),
32 );
33 debug_assert!(
34 r.is_ok(),
35 "setting properties should never fail on our dictionary objects"
36 );
37 let _ = r;
38 self
39 }
40 #[cfg(feature = "Request")]
41 #[doc = "Change the `request` field of this object."]
42 #[doc = ""]
43 #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Request`*"]
44 pub fn request(&mut self, val: &Request) -> &mut Self {
45 use wasm_bindgen::JsValue;
46 let r = ::js_sys::Reflect::set(
47 self.as_ref(),
48 &JsValue::from("request"),
49 &JsValue::from(val),
50 );
51 debug_assert!(
52 r.is_ok(),
53 "setting properties should never fail on our dictionary objects"
54 );
55 let _ = r;
56 self
57 }
58 #[cfg(feature = "Response")]
59 #[doc = "Change the `response` field of this object."]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`, `Response`*"]
62 pub fn response(&mut self, val: &Response) -> &mut Self {
63 use wasm_bindgen::JsValue;
64 let r = ::js_sys::Reflect::set(
65 self.as_ref(),
66 &JsValue::from("response"),
67 &JsValue::from(val),
68 );
69 debug_assert!(
70 r.is_ok(),
71 "setting properties should never fail on our dictionary objects"
72 );
73 let _ = r;
74 self
75 }
76 #[doc = "Change the `type` field of this object."]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `CacheBatchOperation`*"]
79 pub fn type_(&mut self, val: &str) -> &mut Self {
80 use wasm_bindgen::JsValue;
81 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val));
82 debug_assert!(
83 r.is_ok(),
84 "setting properties should never fail on our dictionary objects"
85 );
86 let _ = r;
87 self
88 }
89}
90impl Default for CacheBatchOperation {
91 fn default() -> Self {
92 Self::new()
93 }
94}