Skip to main content

web_sys/features/
gen_AesCtrParams.rs

1#![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 = AesCtrParams)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `AesCtrParams` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
12    pub type AesCtrParams;
13    #[doc = "Get the `name` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
16    #[wasm_bindgen(method, getter = "name")]
17    pub fn get_name(this: &AesCtrParams) -> ::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: `AesCtrParams`*"]
21    #[wasm_bindgen(method, setter = "name")]
22    pub fn set_name(this: &AesCtrParams, val: &str);
23    #[doc = "Get the `counter` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
26    #[wasm_bindgen(method, getter = "counter")]
27    pub fn get_counter(this: &AesCtrParams) -> ::js_sys::Object;
28    #[doc = "Change the `counter` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
31    #[wasm_bindgen(method, setter = "counter")]
32    pub fn set_counter(this: &AesCtrParams, val: &::js_sys::Object);
33    #[doc = "Change the `counter` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
36    #[wasm_bindgen(method, setter = "counter")]
37    pub fn set_counter_buffer_source(this: &AesCtrParams, val: &::js_sys::Object);
38    #[doc = "Change the `counter` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
41    #[wasm_bindgen(method, setter = "counter")]
42    pub fn set_counter_u8_slice(this: &AesCtrParams, val: &mut [u8]);
43    #[doc = "Change the `counter` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
46    #[wasm_bindgen(method, setter = "counter")]
47    pub fn set_counter_u8_array(this: &AesCtrParams, val: &::js_sys::Uint8Array);
48    #[doc = "Get the `length` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
51    #[wasm_bindgen(method, getter = "length")]
52    pub fn get_length(this: &AesCtrParams) -> u8;
53    #[doc = "Change the `length` field of this object."]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
56    #[wasm_bindgen(method, setter = "length")]
57    pub fn set_length(this: &AesCtrParams, val: u8);
58}
59impl AesCtrParams {
60    #[doc = "Construct a new `AesCtrParams`."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
63    pub fn new(name: &str, counter: &::js_sys::Object, length: u8) -> Self {
64        #[allow(unused_mut)]
65        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
66        ret.set_name(name);
67        ret.set_counter(counter);
68        ret.set_length(length);
69        ret
70    }
71    #[doc = "Construct a new `AesCtrParams`."]
72    #[doc = ""]
73    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
74    pub fn new_with_u8_slice(name: &str, counter: &mut [u8], length: u8) -> Self {
75        #[allow(unused_mut)]
76        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
77        ret.set_name(name);
78        ret.set_counter_u8_slice(counter);
79        ret.set_length(length);
80        ret
81    }
82    #[doc = "Construct a new `AesCtrParams`."]
83    #[doc = ""]
84    #[doc = "*This API requires the following crate features to be activated: `AesCtrParams`*"]
85    pub fn new_with_u8_array(name: &str, counter: &::js_sys::Uint8Array, length: u8) -> Self {
86        #[allow(unused_mut)]
87        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
88        ret.set_name(name);
89        ret.set_counter_u8_array(counter);
90        ret.set_length(length);
91        ret
92    }
93    #[deprecated = "Use `set_name()` instead."]
94    pub fn name(&mut self, val: &str) -> &mut Self {
95        self.set_name(val);
96        self
97    }
98    #[deprecated = "Use `set_counter()` instead."]
99    pub fn counter(&mut self, val: &::js_sys::Object) -> &mut Self {
100        self.set_counter(val);
101        self
102    }
103    #[deprecated = "Use `set_length()` instead."]
104    pub fn length(&mut self, val: u8) -> &mut Self {
105        self.set_length(val);
106        self
107    }
108}