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