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 = HmacKeyGenParams)] 7 #[derive(Debug, Clone, PartialEq, Eq)] 8 #[doc = "The `HmacKeyGenParams` dictionary."] 9 #[doc = ""] 10 #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] 11 pub type HmacKeyGenParams; 12 } 13 impl HmacKeyGenParams { 14 #[doc = "Construct a new `HmacKeyGenParams`."] 15 #[doc = ""] 16 #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] new(name: &str, hash: &::wasm_bindgen::JsValue) -> Self17 pub fn new(name: &str, hash: &::wasm_bindgen::JsValue) -> 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.hash(hash); 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: `HmacKeyGenParams`*"] 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 `hash` field of this object."] 38 #[doc = ""] 39 #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self40 pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { 41 use wasm_bindgen::JsValue; 42 let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("hash"), &JsValue::from(val)); 43 debug_assert!( 44 r.is_ok(), 45 "setting properties should never fail on our dictionary objects" 46 ); 47 let _ = r; 48 self 49 } 50 #[doc = "Change the `length` field of this object."] 51 #[doc = ""] 52 #[doc = "*This API requires the following crate features to be activated: `HmacKeyGenParams`*"] length(&mut self, val: u32) -> &mut Self53 pub fn length(&mut self, val: u32) -> &mut Self { 54 use wasm_bindgen::JsValue; 55 let r = 56 ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("length"), &JsValue::from(val)); 57 debug_assert!( 58 r.is_ok(), 59 "setting properties should never fail on our dictionary objects" 60 ); 61 let _ = r; 62 self 63 } 64 } 65