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 = EcdhKeyDeriveParams)]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `EcdhKeyDeriveParams` dictionary."]
9     #[doc = ""]
10     #[doc = "*This API requires the following crate features to be activated: `EcdhKeyDeriveParams`*"]
11     pub type EcdhKeyDeriveParams;
12 }
13 impl EcdhKeyDeriveParams {
14     #[cfg(feature = "CryptoKey")]
15     #[doc = "Construct a new `EcdhKeyDeriveParams`."]
16     #[doc = ""]
17     #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `EcdhKeyDeriveParams`*"]
new(name: &str, public: &CryptoKey) -> Self18     pub fn new(name: &str, public: &CryptoKey) -> Self {
19         #[allow(unused_mut)]
20         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
21         ret.name(name);
22         ret.public(public);
23         ret
24     }
25     #[doc = "Change the `name` field of this object."]
26     #[doc = ""]
27     #[doc = "*This API requires the following crate features to be activated: `EcdhKeyDeriveParams`*"]
name(&mut self, val: &str) -> &mut Self28     pub fn name(&mut self, val: &str) -> &mut Self {
29         use wasm_bindgen::JsValue;
30         let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("name"), &JsValue::from(val));
31         debug_assert!(
32             r.is_ok(),
33             "setting properties should never fail on our dictionary objects"
34         );
35         let _ = r;
36         self
37     }
38     #[cfg(feature = "CryptoKey")]
39     #[doc = "Change the `public` field of this object."]
40     #[doc = ""]
41     #[doc = "*This API requires the following crate features to be activated: `CryptoKey`, `EcdhKeyDeriveParams`*"]
public(&mut self, val: &CryptoKey) -> &mut Self42     pub fn public(&mut self, val: &CryptoKey) -> &mut Self {
43         use wasm_bindgen::JsValue;
44         let r =
45             ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("public"), &JsValue::from(val));
46         debug_assert!(
47             r.is_ok(),
48             "setting properties should never fail on our dictionary objects"
49         );
50         let _ = r;
51         self
52     }
53 }
54