1 | #![allow (unused_imports)] |
2 | #![allow (clippy::all)] |
3 | use super::*; |
4 | use wasm_bindgen::prelude::*; |
5 | #[wasm_bindgen ] |
6 | unsafeextern "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 unsafefn 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 unsafefn set_auto_allocate_chunk_size(this: &UnderlyingSource, val: f64); |
23 | #[doc = "Get the `cancel` field of this object." ] |
24 | #[doc = "" ] |
25 | #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*" ] |
26 | #[wasm_bindgen (method, getter = "cancel" )] |
27 | pub unsafefn get_cancel(this: &UnderlyingSource) -> Option<::js_sys::Function>; |
28 | #[doc = "Change the `cancel` field of this object." ] |
29 | #[doc = "" ] |
30 | #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*" ] |
31 | #[wasm_bindgen (method, setter = "cancel" )] |
32 | pub unsafefn set_cancel(this: &UnderlyingSource, val: &::js_sys::Function); |
33 | #[doc = "Get the `pull` field of this object." ] |
34 | #[doc = "" ] |
35 | #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*" ] |
36 | #[wasm_bindgen (method, getter = "pull" )] |
37 | pub unsafefn get_pull(this: &UnderlyingSource) -> Option<::js_sys::Function>; |
38 | #[doc = "Change the `pull` field of this object." ] |
39 | #[doc = "" ] |
40 | #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*" ] |
41 | #[wasm_bindgen (method, setter = "pull" )] |
42 | pub unsafefn set_pull(this: &UnderlyingSource, val: &::js_sys::Function); |
43 | #[doc = "Get the `start` field of this object." ] |
44 | #[doc = "" ] |
45 | #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*" ] |
46 | #[wasm_bindgen (method, getter = "start" )] |
47 | pub unsafefn get_start(this: &UnderlyingSource) -> Option<::js_sys::Function>; |
48 | #[doc = "Change the `start` field of this object." ] |
49 | #[doc = "" ] |
50 | #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*" ] |
51 | #[wasm_bindgen (method, setter = "start" )] |
52 | pub unsafefn set_start(this: &UnderlyingSource, val: &::js_sys::Function); |
53 | #[cfg (feature = "ReadableStreamType" )] |
54 | #[doc = "Get the `type` field of this object." ] |
55 | #[doc = "" ] |
56 | #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*" ] |
57 | #[wasm_bindgen (method, getter = "type" )] |
58 | pub unsafefn get_type(this: &UnderlyingSource) -> Option<ReadableStreamType>; |
59 | #[cfg (feature = "ReadableStreamType" )] |
60 | #[doc = "Change the `type` field of this object." ] |
61 | #[doc = "" ] |
62 | #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*" ] |
63 | #[wasm_bindgen (method, setter = "type" )] |
64 | pub unsafefn set_type(this: &UnderlyingSource, val: ReadableStreamType); |
65 | } |
66 | impl UnderlyingSource { |
67 | #[doc = "Construct a new `UnderlyingSource`." ] |
68 | #[doc = "" ] |
69 | #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*" ] |
70 | pub fn new() -> Self { |
71 | #[allow (unused_mut)] |
72 | let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); |
73 | ret |
74 | } |
75 | #[deprecated = "Use `set_auto_allocate_chunk_size()` instead." ] |
76 | pub fn auto_allocate_chunk_size(&mut self, val: f64) -> &mut Self { |
77 | self.set_auto_allocate_chunk_size(val); |
78 | self |
79 | } |
80 | #[deprecated = "Use `set_cancel()` instead." ] |
81 | pub fn cancel(&mut self, val: &::js_sys::Function) -> &mut Self { |
82 | self.set_cancel(val); |
83 | self |
84 | } |
85 | #[deprecated = "Use `set_pull()` instead." ] |
86 | pub fn pull(&mut self, val: &::js_sys::Function) -> &mut Self { |
87 | self.set_pull(val); |
88 | self |
89 | } |
90 | #[deprecated = "Use `set_start()` instead." ] |
91 | pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { |
92 | self.set_start(val); |
93 | self |
94 | } |
95 | #[cfg (feature = "ReadableStreamType" )] |
96 | #[deprecated = "Use `set_type()` instead." ] |
97 | pub fn type_(&mut self, val: ReadableStreamType) -> &mut Self { |
98 | self.set_type(val); |
99 | self |
100 | } |
101 | } |
102 | impl Default for UnderlyingSource { |
103 | fn default() -> Self { |
104 | Self::new() |
105 | } |
106 | } |
107 | |