web_sys/features/
gen_UnderlyingSource.rs1#![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 = UnderlyingSource)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `UnderlyingSource` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
12 pub type UnderlyingSource;
13 #[doc = "Get the `autoAllocateChunkSize` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
16 #[wasm_bindgen(method, getter = "autoAllocateChunkSize")]
17 pub fn get_auto_allocate_chunk_size(this: &UnderlyingSource) -> Option<f64>;
18 #[doc = "Change the `autoAllocateChunkSize` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
21 #[wasm_bindgen(method, setter = "autoAllocateChunkSize")]
22 pub fn set_auto_allocate_chunk_size(this: &UnderlyingSource, val: f64);
23 #[doc = "Change the `autoAllocateChunkSize` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
26 #[wasm_bindgen(method, setter = "autoAllocateChunkSize")]
27 pub fn set_auto_allocate_chunk_size_u32(this: &UnderlyingSource, val: u32);
28 #[doc = "Change the `autoAllocateChunkSize` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
31 #[wasm_bindgen(method, setter = "autoAllocateChunkSize")]
32 pub fn set_auto_allocate_chunk_size_f64(this: &UnderlyingSource, val: f64);
33 #[doc = "Get the `cancel` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
36 #[wasm_bindgen(method, getter = "cancel")]
37 pub fn get_cancel(this: &UnderlyingSource) -> Option<::js_sys::Function>;
38 #[doc = "Change the `cancel` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
41 #[wasm_bindgen(method, setter = "cancel")]
42 pub fn set_cancel(this: &UnderlyingSource, val: &::js_sys::Function);
43 #[doc = "Get the `pull` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
46 #[wasm_bindgen(method, getter = "pull")]
47 pub fn get_pull(this: &UnderlyingSource) -> Option<::js_sys::Function>;
48 #[doc = "Change the `pull` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
51 #[wasm_bindgen(method, setter = "pull")]
52 pub fn set_pull(this: &UnderlyingSource, val: &::js_sys::Function);
53 #[doc = "Get the `start` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
56 #[wasm_bindgen(method, getter = "start")]
57 pub fn get_start(this: &UnderlyingSource) -> Option<::js_sys::Function>;
58 #[doc = "Change the `start` field of this object."]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
61 #[wasm_bindgen(method, setter = "start")]
62 pub fn set_start(this: &UnderlyingSource, val: &::js_sys::Function);
63 #[cfg(feature = "ReadableStreamType")]
64 #[doc = "Get the `type` field of this object."]
65 #[doc = ""]
66 #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*"]
67 #[wasm_bindgen(method, getter = "type")]
68 pub fn get_type(this: &UnderlyingSource) -> Option<ReadableStreamType>;
69 #[cfg(feature = "ReadableStreamType")]
70 #[doc = "Change the `type` field of this object."]
71 #[doc = ""]
72 #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*"]
73 #[wasm_bindgen(method, setter = "type")]
74 pub fn set_type(this: &UnderlyingSource, val: ReadableStreamType);
75}
76impl UnderlyingSource {
77 #[doc = "Construct a new `UnderlyingSource`."]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"]
80 pub fn new() -> Self {
81 #[allow(unused_mut)]
82 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
83 ret
84 }
85 #[deprecated = "Use `set_auto_allocate_chunk_size()` instead."]
86 pub fn auto_allocate_chunk_size(&mut self, val: f64) -> &mut Self {
87 self.set_auto_allocate_chunk_size(val);
88 self
89 }
90 #[deprecated = "Use `set_cancel()` instead."]
91 pub fn cancel(&mut self, val: &::js_sys::Function) -> &mut Self {
92 self.set_cancel(val);
93 self
94 }
95 #[deprecated = "Use `set_pull()` instead."]
96 pub fn pull(&mut self, val: &::js_sys::Function) -> &mut Self {
97 self.set_pull(val);
98 self
99 }
100 #[deprecated = "Use `set_start()` instead."]
101 pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self {
102 self.set_start(val);
103 self
104 }
105 #[cfg(feature = "ReadableStreamType")]
106 #[deprecated = "Use `set_type()` instead."]
107 pub fn type_(&mut self, val: ReadableStreamType) -> &mut Self {
108 self.set_type(val);
109 self
110 }
111}
112impl Default for UnderlyingSource {
113 fn default() -> Self {
114 Self::new()
115 }
116}