web_sys/features/
gen_TextEncoder.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 = TextEncoder , typescript_type = "TextEncoder")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `TextEncoder` class."]
10    #[doc = ""]
11    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder)"]
12    #[doc = ""]
13    #[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"]
14    pub type TextEncoder;
15    # [wasm_bindgen (structural , method , getter , js_class = "TextEncoder" , js_name = encoding)]
16    #[doc = "Getter for the `encoding` field of this object."]
17    #[doc = ""]
18    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encoding)"]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"]
21    pub fn encoding(this: &TextEncoder) -> ::alloc::string::String;
22    #[wasm_bindgen(catch, constructor, js_class = "TextEncoder")]
23    #[doc = "The `new TextEncoder(..)` constructor, creating a new instance of `TextEncoder`."]
24    #[doc = ""]
25    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder)"]
26    #[doc = ""]
27    #[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"]
28    pub fn new() -> Result<TextEncoder, JsValue>;
29    # [wasm_bindgen (method , structural , js_class = "TextEncoder" , js_name = encode)]
30    #[doc = "The `encode()` method."]
31    #[doc = ""]
32    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encode)"]
33    #[doc = ""]
34    #[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"]
35    pub fn encode(this: &TextEncoder) -> ::alloc::vec::Vec<u8>;
36    # [wasm_bindgen (method , structural , js_class = "TextEncoder" , js_name = encode)]
37    #[doc = "The `encode()` method."]
38    #[doc = ""]
39    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encode)"]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"]
42    pub fn encode_with_input(this: &TextEncoder, input: &str) -> ::alloc::vec::Vec<u8>;
43}