Skip to main content

web_sys/features/
gen_Crypto.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "::js_sys::Object",
9        js_name = "Crypto",
10        typescript_type = "Crypto"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `Crypto` class."]
14    #[doc = ""]
15    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Crypto)"]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `Crypto`*"]
18    pub type Crypto;
19    #[cfg(feature = "SubtleCrypto")]
20    #[wasm_bindgen(method, getter, js_class = "Crypto", js_name = "subtle")]
21    #[doc = "Getter for the `subtle` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `Crypto`, `SubtleCrypto`*"]
26    pub fn subtle(this: &Crypto) -> SubtleCrypto;
27    #[wasm_bindgen(catch, method, js_class = "Crypto", js_name = "getRandomValues")]
28    #[doc = "The `getRandomValues()` method."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `Crypto`*"]
33    pub fn get_random_values_with_array_buffer_view(
34        this: &Crypto,
35        array: &::js_sys::Object,
36    ) -> Result<::js_sys::Object, JsValue>;
37    #[wasm_bindgen(catch, method, js_class = "Crypto", js_name = "getRandomValues")]
38    #[doc = "The `getRandomValues()` method."]
39    #[doc = ""]
40    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues)"]
41    #[doc = ""]
42    #[doc = "*This API requires the following crate features to be activated: `Crypto`*"]
43    pub fn get_random_values_with_u8_array(
44        this: &Crypto,
45        array: &mut [u8],
46    ) -> Result<::js_sys::Object, JsValue>;
47    #[wasm_bindgen(catch, method, js_class = "Crypto", js_name = "getRandomValues")]
48    #[doc = "The `getRandomValues()` method."]
49    #[doc = ""]
50    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues)"]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `Crypto`*"]
53    pub fn get_random_values_with_js_u8_array(
54        this: &Crypto,
55        array: &::js_sys::Uint8Array,
56    ) -> Result<::js_sys::Object, JsValue>;
57    #[wasm_bindgen(method, js_class = "Crypto", js_name = "randomUUID")]
58    #[doc = "The `randomUUID()` method."]
59    #[doc = ""]
60    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID)"]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `Crypto`*"]
63    pub fn random_uuid(this: &Crypto) -> ::alloc::string::String;
64}