Skip to main content

web_sys/features/
gen_ReadableStreamIteratorOptions.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 = "ReadableStreamIteratorOptions"
10    )]
11    #[derive(Debug, Clone, PartialEq, Eq)]
12    #[doc = "The `ReadableStreamIteratorOptions` dictionary."]
13    #[doc = ""]
14    #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"]
15    pub type ReadableStreamIteratorOptions;
16    #[doc = "Get the `preventCancel` field of this object."]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"]
19    #[wasm_bindgen(method, getter = "preventCancel")]
20    pub fn get_prevent_cancel(this: &ReadableStreamIteratorOptions) -> Option<bool>;
21    #[doc = "Change the `preventCancel` field of this object."]
22    #[doc = ""]
23    #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"]
24    #[wasm_bindgen(method, setter = "preventCancel")]
25    pub fn set_prevent_cancel(this: &ReadableStreamIteratorOptions, val: bool);
26}
27impl ReadableStreamIteratorOptions {
28    #[doc = "Construct a new `ReadableStreamIteratorOptions`."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `ReadableStreamIteratorOptions`*"]
31    pub fn new() -> Self {
32        #[allow(unused_mut)]
33        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
34        ret
35    }
36    #[deprecated = "Use `set_prevent_cancel()` instead."]
37    pub fn prevent_cancel(&mut self, val: bool) -> &mut Self {
38        self.set_prevent_cancel(val);
39        self
40    }
41}
42impl Default for ReadableStreamIteratorOptions {
43    fn default() -> Self {
44        Self::new()
45    }
46}