1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = EcKeyAlgorithm)]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `EcKeyAlgorithm` dictionary."]
9     #[doc = ""]
10     #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"]
11     pub type EcKeyAlgorithm;
12 }
13 impl EcKeyAlgorithm {
14     #[doc = "Construct a new `EcKeyAlgorithm`."]
15     #[doc = ""]
16     #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"]
new(name: &str, named_curve: &str) -> Self17     pub fn new(name: &str, named_curve: &str) -> Self {
18         #[allow(unused_mut)]
19         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20         ret.name(name);
21         ret.named_curve(named_curve);
22         ret
23     }
24     #[doc = "Change the `name` field of this object."]
25     #[doc = ""]
26     #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"]
name(&mut self, val: &str) -> &mut Self27     pub fn name(&mut self, val: &str) -> &mut Self {
28         use wasm_bindgen::JsValue;
29         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
30         debug_assert!(
31             r.is_ok(),
32             "setting properties should never fail on our dictionary objects"
33         );
34         let _ = r;
35         self
36     }
37     #[doc = "Change the `namedCurve` field of this object."]
38     #[doc = ""]
39     #[doc = "*This API requires the following crate features to be activated: `EcKeyAlgorithm`*"]
named_curve(&mut self, val: &str) -> &mut Self40     pub fn named_curve(&mut self, val: &str) -> &mut Self {
41         use wasm_bindgen::JsValue;
42         let r = ::js_sys::Reflect::set(
43             self.as_ref(),
44             &JsValue::from("namedCurve"),
45             &JsValue::from(val),
46         );
47         debug_assert!(
48             r.is_ok(),
49             "setting properties should never fail on our dictionary objects"
50         );
51         let _ = r;
52         self
53     }
54 }
55