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