web_sys/features/
gen_HmacKeyAlgorithm.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = HmacKeyAlgorithm)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `HmacKeyAlgorithm` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"]
12 pub type HmacKeyAlgorithm;
13 #[doc = "Get the `name` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"]
16 #[wasm_bindgen(method, getter = "name")]
17 pub fn get_name(this: &HmacKeyAlgorithm) -> ::alloc::string::String;
18 #[doc = "Change the `name` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"]
21 #[wasm_bindgen(method, setter = "name")]
22 pub fn set_name(this: &HmacKeyAlgorithm, val: &str);
23 #[cfg(feature = "KeyAlgorithm")]
24 #[doc = "Get the `hash` field of this object."]
25 #[doc = ""]
26 #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`, `KeyAlgorithm`*"]
27 #[wasm_bindgen(method, getter = "hash")]
28 pub fn get_hash(this: &HmacKeyAlgorithm) -> KeyAlgorithm;
29 #[cfg(feature = "KeyAlgorithm")]
30 #[doc = "Change the `hash` field of this object."]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`, `KeyAlgorithm`*"]
33 #[wasm_bindgen(method, setter = "hash")]
34 pub fn set_hash(this: &HmacKeyAlgorithm, val: &KeyAlgorithm);
35 #[doc = "Get the `length` field of this object."]
36 #[doc = ""]
37 #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"]
38 #[wasm_bindgen(method, getter = "length")]
39 pub fn get_length(this: &HmacKeyAlgorithm) -> u32;
40 #[doc = "Change the `length` field of this object."]
41 #[doc = ""]
42 #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`*"]
43 #[wasm_bindgen(method, setter = "length")]
44 pub fn set_length(this: &HmacKeyAlgorithm, val: u32);
45}
46impl HmacKeyAlgorithm {
47 #[cfg(feature = "KeyAlgorithm")]
48 #[doc = "Construct a new `HmacKeyAlgorithm`."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `HmacKeyAlgorithm`, `KeyAlgorithm`*"]
51 pub fn new(name: &str, hash: &KeyAlgorithm, length: u32) -> Self {
52 #[allow(unused_mut)]
53 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
54 ret.set_name(name);
55 ret.set_hash(hash);
56 ret.set_length(length);
57 ret
58 }
59 #[deprecated = "Use `set_name()` instead."]
60 pub fn name(&mut self, val: &str) -> &mut Self {
61 self.set_name(val);
62 self
63 }
64 #[cfg(feature = "KeyAlgorithm")]
65 #[deprecated = "Use `set_hash()` instead."]
66 pub fn hash(&mut self, val: &KeyAlgorithm) -> &mut Self {
67 self.set_hash(val);
68 self
69 }
70 #[deprecated = "Use `set_length()` instead."]
71 pub fn length(&mut self, val: u32) -> &mut Self {
72 self.set_length(val);
73 self
74 }
75}