web_sys/features/
gen_HkdfParams.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 = HkdfParams)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `HkdfParams` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
12 pub type HkdfParams;
13 #[doc = "Get the `name` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
16 #[wasm_bindgen(method, getter = "name")]
17 pub fn get_name(this: &HkdfParams) -> ::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: `HkdfParams`*"]
21 #[wasm_bindgen(method, setter = "name")]
22 pub fn set_name(this: &HkdfParams, val: &str);
23 #[doc = "Get the `hash` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
26 #[wasm_bindgen(method, getter = "hash")]
27 pub fn get_hash(this: &HkdfParams) -> ::wasm_bindgen::JsValue;
28 #[doc = "Change the `hash` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
31 #[wasm_bindgen(method, setter = "hash")]
32 pub fn set_hash(this: &HkdfParams, val: &::wasm_bindgen::JsValue);
33 #[doc = "Change the `hash` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
36 #[wasm_bindgen(method, setter = "hash")]
37 pub fn set_hash_object(this: &HkdfParams, val: &::js_sys::Object);
38 #[doc = "Change the `hash` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
41 #[wasm_bindgen(method, setter = "hash")]
42 pub fn set_hash_str(this: &HkdfParams, val: &str);
43 #[doc = "Get the `info` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
46 #[wasm_bindgen(method, getter = "info")]
47 pub fn get_info(this: &HkdfParams) -> ::js_sys::Object;
48 #[doc = "Change the `info` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
51 #[wasm_bindgen(method, setter = "info")]
52 pub fn set_info(this: &HkdfParams, val: &::js_sys::Object);
53 #[doc = "Change the `info` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
56 #[wasm_bindgen(method, setter = "info")]
57 pub fn set_info_buffer_source(this: &HkdfParams, val: &::js_sys::Object);
58 #[doc = "Change the `info` field of this object."]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
61 #[wasm_bindgen(method, setter = "info")]
62 pub fn set_info_u8_slice(this: &HkdfParams, val: &mut [u8]);
63 #[doc = "Change the `info` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
66 #[wasm_bindgen(method, setter = "info")]
67 pub fn set_info_u8_array(this: &HkdfParams, val: &::js_sys::Uint8Array);
68 #[doc = "Get the `salt` field of this object."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
71 #[wasm_bindgen(method, getter = "salt")]
72 pub fn get_salt(this: &HkdfParams) -> ::js_sys::Object;
73 #[doc = "Change the `salt` field of this object."]
74 #[doc = ""]
75 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
76 #[wasm_bindgen(method, setter = "salt")]
77 pub fn set_salt(this: &HkdfParams, val: &::js_sys::Object);
78 #[doc = "Change the `salt` field of this object."]
79 #[doc = ""]
80 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
81 #[wasm_bindgen(method, setter = "salt")]
82 pub fn set_salt_buffer_source(this: &HkdfParams, val: &::js_sys::Object);
83 #[doc = "Change the `salt` field of this object."]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
86 #[wasm_bindgen(method, setter = "salt")]
87 pub fn set_salt_u8_slice(this: &HkdfParams, val: &mut [u8]);
88 #[doc = "Change the `salt` field of this object."]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
91 #[wasm_bindgen(method, setter = "salt")]
92 pub fn set_salt_u8_array(this: &HkdfParams, val: &::js_sys::Uint8Array);
93}
94impl HkdfParams {
95 #[doc = "Construct a new `HkdfParams`."]
96 #[doc = ""]
97 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
98 pub fn new(
99 name: &str,
100 hash: &::wasm_bindgen::JsValue,
101 info: &::js_sys::Object,
102 salt: &::js_sys::Object,
103 ) -> Self {
104 #[allow(unused_mut)]
105 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
106 ret.set_name(name);
107 ret.set_hash(hash);
108 ret.set_info(info);
109 ret.set_salt(salt);
110 ret
111 }
112 #[doc = "Construct a new `HkdfParams`."]
113 #[doc = ""]
114 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
115 pub fn new_with_object(
116 name: &str,
117 hash: &::js_sys::Object,
118 info: &::js_sys::Object,
119 salt: &::js_sys::Object,
120 ) -> Self {
121 #[allow(unused_mut)]
122 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
123 ret.set_name(name);
124 ret.set_hash_object(hash);
125 ret.set_info(info);
126 ret.set_salt(salt);
127 ret
128 }
129 #[doc = "Construct a new `HkdfParams`."]
130 #[doc = ""]
131 #[doc = "*This API requires the following crate features to be activated: `HkdfParams`*"]
132 pub fn new_with_str(
133 name: &str,
134 hash: &str,
135 info: &::js_sys::Object,
136 salt: &::js_sys::Object,
137 ) -> Self {
138 #[allow(unused_mut)]
139 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
140 ret.set_name(name);
141 ret.set_hash_str(hash);
142 ret.set_info(info);
143 ret.set_salt(salt);
144 ret
145 }
146 #[deprecated = "Use `set_name()` instead."]
147 pub fn name(&mut self, val: &str) -> &mut Self {
148 self.set_name(val);
149 self
150 }
151 #[deprecated = "Use `set_hash()` instead."]
152 pub fn hash(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
153 self.set_hash(val);
154 self
155 }
156 #[deprecated = "Use `set_info()` instead."]
157 pub fn info(&mut self, val: &::js_sys::Object) -> &mut Self {
158 self.set_info(val);
159 self
160 }
161 #[deprecated = "Use `set_salt()` instead."]
162 pub fn salt(&mut self, val: &::js_sys::Object) -> &mut Self {
163 self.set_salt(val);
164 self
165 }
166}