maxcountryman_web_sys/features/
gen_JsonWebKey.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = JsonWebKey)]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `JsonWebKey` dictionary."]
9 #[doc = ""]
10 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
11 pub type JsonWebKey;
12}
13impl JsonWebKey {
14 #[doc = "Construct a new `JsonWebKey`."]
15 #[doc = ""]
16 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
17 pub fn new(kty: &str) -> Self {
18 #[allow(unused_mut)]
19 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20 ret.kty(kty);
21 ret
22 }
23 #[doc = "Change the `alg` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
26 pub fn alg(&mut self, val: &str) -> &mut Self {
27 use wasm_bindgen::JsValue;
28 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("alg"), &JsValue::from(val));
29 debug_assert!(
30 r.is_ok(),
31 "setting properties should never fail on our dictionary objects"
32 );
33 let _ = r;
34 self
35 }
36 #[doc = "Change the `crv` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
39 pub fn crv(&mut self, val: &str) -> &mut Self {
40 use wasm_bindgen::JsValue;
41 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("crv"), &JsValue::from(val));
42 debug_assert!(
43 r.is_ok(),
44 "setting properties should never fail on our dictionary objects"
45 );
46 let _ = r;
47 self
48 }
49 #[doc = "Change the `d` field of this object."]
50 #[doc = ""]
51 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
52 pub fn d(&mut self, val: &str) -> &mut Self {
53 use wasm_bindgen::JsValue;
54 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("d"), &JsValue::from(val));
55 debug_assert!(
56 r.is_ok(),
57 "setting properties should never fail on our dictionary objects"
58 );
59 let _ = r;
60 self
61 }
62 #[doc = "Change the `dp` field of this object."]
63 #[doc = ""]
64 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
65 pub fn dp(&mut self, val: &str) -> &mut Self {
66 use wasm_bindgen::JsValue;
67 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dp"), &JsValue::from(val));
68 debug_assert!(
69 r.is_ok(),
70 "setting properties should never fail on our dictionary objects"
71 );
72 let _ = r;
73 self
74 }
75 #[doc = "Change the `dq` field of this object."]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
78 pub fn dq(&mut self, val: &str) -> &mut Self {
79 use wasm_bindgen::JsValue;
80 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("dq"), &JsValue::from(val));
81 debug_assert!(
82 r.is_ok(),
83 "setting properties should never fail on our dictionary objects"
84 );
85 let _ = r;
86 self
87 }
88 #[doc = "Change the `e` field of this object."]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
91 pub fn e(&mut self, val: &str) -> &mut Self {
92 use wasm_bindgen::JsValue;
93 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("e"), &JsValue::from(val));
94 debug_assert!(
95 r.is_ok(),
96 "setting properties should never fail on our dictionary objects"
97 );
98 let _ = r;
99 self
100 }
101 #[doc = "Change the `ext` field of this object."]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
104 pub fn ext(&mut self, val: bool) -> &mut Self {
105 use wasm_bindgen::JsValue;
106 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("ext"), &JsValue::from(val));
107 debug_assert!(
108 r.is_ok(),
109 "setting properties should never fail on our dictionary objects"
110 );
111 let _ = r;
112 self
113 }
114 #[doc = "Change the `k` field of this object."]
115 #[doc = ""]
116 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
117 pub fn k(&mut self, val: &str) -> &mut Self {
118 use wasm_bindgen::JsValue;
119 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("k"), &JsValue::from(val));
120 debug_assert!(
121 r.is_ok(),
122 "setting properties should never fail on our dictionary objects"
123 );
124 let _ = r;
125 self
126 }
127 #[doc = "Change the `key_ops` field of this object."]
128 #[doc = ""]
129 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
130 pub fn key_ops(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
131 use wasm_bindgen::JsValue;
132 let r = ::js_sys::Reflect::set(
133 self.as_ref(),
134 &JsValue::from("key_ops"),
135 &JsValue::from(val),
136 );
137 debug_assert!(
138 r.is_ok(),
139 "setting properties should never fail on our dictionary objects"
140 );
141 let _ = r;
142 self
143 }
144 #[doc = "Change the `kty` field of this object."]
145 #[doc = ""]
146 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
147 pub fn kty(&mut self, val: &str) -> &mut Self {
148 use wasm_bindgen::JsValue;
149 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("kty"), &JsValue::from(val));
150 debug_assert!(
151 r.is_ok(),
152 "setting properties should never fail on our dictionary objects"
153 );
154 let _ = r;
155 self
156 }
157 #[doc = "Change the `n` field of this object."]
158 #[doc = ""]
159 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
160 pub fn n(&mut self, val: &str) -> &mut Self {
161 use wasm_bindgen::JsValue;
162 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("n"), &JsValue::from(val));
163 debug_assert!(
164 r.is_ok(),
165 "setting properties should never fail on our dictionary objects"
166 );
167 let _ = r;
168 self
169 }
170 #[doc = "Change the `oth` field of this object."]
171 #[doc = ""]
172 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
173 pub fn oth(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
174 use wasm_bindgen::JsValue;
175 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("oth"), &JsValue::from(val));
176 debug_assert!(
177 r.is_ok(),
178 "setting properties should never fail on our dictionary objects"
179 );
180 let _ = r;
181 self
182 }
183 #[doc = "Change the `p` field of this object."]
184 #[doc = ""]
185 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
186 pub fn p(&mut self, val: &str) -> &mut Self {
187 use wasm_bindgen::JsValue;
188 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("p"), &JsValue::from(val));
189 debug_assert!(
190 r.is_ok(),
191 "setting properties should never fail on our dictionary objects"
192 );
193 let _ = r;
194 self
195 }
196 #[doc = "Change the `q` field of this object."]
197 #[doc = ""]
198 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
199 pub fn q(&mut self, val: &str) -> &mut Self {
200 use wasm_bindgen::JsValue;
201 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("q"), &JsValue::from(val));
202 debug_assert!(
203 r.is_ok(),
204 "setting properties should never fail on our dictionary objects"
205 );
206 let _ = r;
207 self
208 }
209 #[doc = "Change the `qi` field of this object."]
210 #[doc = ""]
211 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
212 pub fn qi(&mut self, val: &str) -> &mut Self {
213 use wasm_bindgen::JsValue;
214 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("qi"), &JsValue::from(val));
215 debug_assert!(
216 r.is_ok(),
217 "setting properties should never fail on our dictionary objects"
218 );
219 let _ = r;
220 self
221 }
222 #[doc = "Change the `use` field of this object."]
223 #[doc = ""]
224 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
225 pub fn use_(&mut self, val: &str) -> &mut Self {
226 use wasm_bindgen::JsValue;
227 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("use"), &JsValue::from(val));
228 debug_assert!(
229 r.is_ok(),
230 "setting properties should never fail on our dictionary objects"
231 );
232 let _ = r;
233 self
234 }
235 #[doc = "Change the `x` field of this object."]
236 #[doc = ""]
237 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
238 pub fn x(&mut self, val: &str) -> &mut Self {
239 use wasm_bindgen::JsValue;
240 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("x"), &JsValue::from(val));
241 debug_assert!(
242 r.is_ok(),
243 "setting properties should never fail on our dictionary objects"
244 );
245 let _ = r;
246 self
247 }
248 #[doc = "Change the `y` field of this object."]
249 #[doc = ""]
250 #[doc = "*This API requires the following crate features to be activated: `JsonWebKey`*"]
251 pub fn y(&mut self, val: &str) -> &mut Self {
252 use wasm_bindgen::JsValue;
253 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("y"), &JsValue::from(val));
254 debug_assert!(
255 r.is_ok(),
256 "setting properties should never fail on our dictionary objects"
257 );
258 let _ = r;
259 self
260 }
261}