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