Skip to main content

web_sys/features/
gen_ReadableStream.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 = "ReadableStream",
10        typescript_type = "ReadableStream"
11    )]
12    #[derive(Debug, Clone, PartialEq, Eq)]
13    #[doc = "The `ReadableStream` class."]
14    #[doc = ""]
15    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)"]
16    #[doc = ""]
17    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
18    pub type ReadableStream;
19    #[wasm_bindgen(method, getter, js_class = "ReadableStream", js_name = "locked")]
20    #[doc = "Getter for the `locked` field of this object."]
21    #[doc = ""]
22    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/locked)"]
23    #[doc = ""]
24    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
25    pub fn locked(this: &ReadableStream) -> bool;
26    #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")]
27    #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."]
28    #[doc = ""]
29    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
32    pub fn new() -> Result<ReadableStream, JsValue>;
33    #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")]
34    #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."]
35    #[doc = ""]
36    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"]
37    #[doc = ""]
38    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
39    pub fn new_with_underlying_source(
40        underlying_source: &::js_sys::Object,
41    ) -> Result<ReadableStream, JsValue>;
42    #[cfg(feature = "QueuingStrategy")]
43    #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")]
44    #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."]
45    #[doc = ""]
46    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"]
47    #[doc = ""]
48    #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `ReadableStream`*"]
49    pub fn new_with_underlying_source_and_strategy(
50        underlying_source: &::js_sys::Object,
51        strategy: &QueuingStrategy,
52    ) -> Result<ReadableStream, JsValue>;
53    #[wasm_bindgen(method, js_class = "ReadableStream")]
54    #[doc = "The `cancel()` method."]
55    #[doc = ""]
56    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/cancel)"]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
59    pub fn cancel(this: &ReadableStream) -> ::js_sys::Promise;
60    #[wasm_bindgen(method, js_class = "ReadableStream", js_name = "cancel")]
61    #[doc = "The `cancel()` method."]
62    #[doc = ""]
63    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/cancel)"]
64    #[doc = ""]
65    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
66    pub fn cancel_with_reason(
67        this: &ReadableStream,
68        reason: &::wasm_bindgen::JsValue,
69    ) -> ::js_sys::Promise;
70    #[wasm_bindgen(method, js_class = "ReadableStream", js_name = "getReader")]
71    #[doc = "The `getReader()` method."]
72    #[doc = ""]
73    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/getReader)"]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
76    pub fn get_reader(this: &ReadableStream) -> ::js_sys::Object;
77    #[cfg(feature = "ReadableStreamGetReaderOptions")]
78    #[wasm_bindgen(method, js_class = "ReadableStream", js_name = "getReader")]
79    #[doc = "The `getReader()` method."]
80    #[doc = ""]
81    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/getReader)"]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamGetReaderOptions`*"]
84    pub fn get_reader_with_options(
85        this: &ReadableStream,
86        options: &ReadableStreamGetReaderOptions,
87    ) -> ::js_sys::Object;
88    #[cfg(feature = "ReadableWritablePair")]
89    #[wasm_bindgen(method, js_class = "ReadableStream", js_name = "pipeThrough")]
90    #[doc = "The `pipeThrough()` method."]
91    #[doc = ""]
92    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeThrough)"]
93    #[doc = ""]
94    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`*"]
95    pub fn pipe_through(this: &ReadableStream, transform: &ReadableWritablePair) -> ReadableStream;
96    #[cfg(all(feature = "ReadableWritablePair", feature = "StreamPipeOptions",))]
97    #[wasm_bindgen(method, js_class = "ReadableStream", js_name = "pipeThrough")]
98    #[doc = "The `pipeThrough()` method."]
99    #[doc = ""]
100    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeThrough)"]
101    #[doc = ""]
102    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`, `StreamPipeOptions`*"]
103    pub fn pipe_through_with_options(
104        this: &ReadableStream,
105        transform: &ReadableWritablePair,
106        options: &StreamPipeOptions,
107    ) -> ReadableStream;
108    #[cfg(feature = "WritableStream")]
109    #[wasm_bindgen(method, js_class = "ReadableStream", js_name = "pipeTo")]
110    #[doc = "The `pipeTo()` method."]
111    #[doc = ""]
112    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"]
113    #[doc = ""]
114    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WritableStream`*"]
115    pub fn pipe_to(this: &ReadableStream, destination: &WritableStream) -> ::js_sys::Promise;
116    #[cfg(all(feature = "StreamPipeOptions", feature = "WritableStream",))]
117    #[wasm_bindgen(method, js_class = "ReadableStream", js_name = "pipeTo")]
118    #[doc = "The `pipeTo()` method."]
119    #[doc = ""]
120    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"]
121    #[doc = ""]
122    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `StreamPipeOptions`, `WritableStream`*"]
123    pub fn pipe_to_with_options(
124        this: &ReadableStream,
125        destination: &WritableStream,
126        options: &StreamPipeOptions,
127    ) -> ::js_sys::Promise;
128    #[wasm_bindgen(method, js_class = "ReadableStream")]
129    #[doc = "The `tee()` method."]
130    #[doc = ""]
131    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/tee)"]
132    #[doc = ""]
133    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
134    pub fn tee(this: &ReadableStream) -> ::js_sys::Array;
135    #[wasm_bindgen(method, js_class = "ReadableStream")]
136    #[doc = "The `entries()` method."]
137    #[doc = ""]
138    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/entries)"]
139    #[doc = ""]
140    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
141    pub fn entries(this: &ReadableStream) -> ::js_sys::AsyncIterator;
142    #[wasm_bindgen(method, js_class = "ReadableStream")]
143    #[doc = "The `keys()` method."]
144    #[doc = ""]
145    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/keys)"]
146    #[doc = ""]
147    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
148    pub fn keys(this: &ReadableStream) -> ::js_sys::AsyncIterator;
149    #[wasm_bindgen(method, js_class = "ReadableStream")]
150    #[doc = "The `values()` method."]
151    #[doc = ""]
152    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/values)"]
153    #[doc = ""]
154    #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
155    pub fn values(this: &ReadableStream) -> ::js_sys::AsyncIterator;
156}