1 | #![allow (unused_imports)] |
2 | #![allow (clippy::all)] |
3 | use super::*; |
4 | use wasm_bindgen::prelude::*; |
5 | #[wasm_bindgen ] |
6 | extern "C" { |
7 | # [wasm_bindgen (extends = :: js_sys :: Object , js_name = StreamPipeOptions)] |
8 | #[derive (Debug, Clone, PartialEq, Eq)] |
9 | #[doc = "The `StreamPipeOptions` dictionary." ] |
10 | #[doc = "" ] |
11 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
12 | pub type StreamPipeOptions; |
13 | } |
14 | impl StreamPipeOptions { |
15 | #[doc = "Construct a new `StreamPipeOptions`." ] |
16 | #[doc = "" ] |
17 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
18 | pub fn new() -> Self { |
19 | #[allow (unused_mut)] |
20 | let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); |
21 | ret |
22 | } |
23 | #[doc = "Change the `preventAbort` field of this object." ] |
24 | #[doc = "" ] |
25 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
26 | pub fn prevent_abort(&mut self, val: bool) -> &mut Self { |
27 | use wasm_bindgen::JsValue; |
28 | let r = ::js_sys::Reflect::set( |
29 | self.as_ref(), |
30 | &JsValue::from("preventAbort" ), |
31 | &JsValue::from(val), |
32 | ); |
33 | debug_assert!( |
34 | r.is_ok(), |
35 | "setting properties should never fail on our dictionary objects" |
36 | ); |
37 | let _ = r; |
38 | self |
39 | } |
40 | #[doc = "Change the `preventCancel` field of this object." ] |
41 | #[doc = "" ] |
42 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
43 | pub fn prevent_cancel(&mut self, val: bool) -> &mut Self { |
44 | use wasm_bindgen::JsValue; |
45 | let r = ::js_sys::Reflect::set( |
46 | self.as_ref(), |
47 | &JsValue::from("preventCancel" ), |
48 | &JsValue::from(val), |
49 | ); |
50 | debug_assert!( |
51 | r.is_ok(), |
52 | "setting properties should never fail on our dictionary objects" |
53 | ); |
54 | let _ = r; |
55 | self |
56 | } |
57 | #[doc = "Change the `preventClose` field of this object." ] |
58 | #[doc = "" ] |
59 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
60 | pub fn prevent_close(&mut self, val: bool) -> &mut Self { |
61 | use wasm_bindgen::JsValue; |
62 | let r = ::js_sys::Reflect::set( |
63 | self.as_ref(), |
64 | &JsValue::from("preventClose" ), |
65 | &JsValue::from(val), |
66 | ); |
67 | debug_assert!( |
68 | r.is_ok(), |
69 | "setting properties should never fail on our dictionary objects" |
70 | ); |
71 | let _ = r; |
72 | self |
73 | } |
74 | #[cfg (feature = "AbortSignal" )] |
75 | #[doc = "Change the `signal` field of this object." ] |
76 | #[doc = "" ] |
77 | #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `StreamPipeOptions`*" ] |
78 | pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { |
79 | use wasm_bindgen::JsValue; |
80 | let r = |
81 | ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("signal" ), &JsValue::from(val)); |
82 | debug_assert!( |
83 | r.is_ok(), |
84 | "setting properties should never fail on our dictionary objects" |
85 | ); |
86 | let _ = r; |
87 | self |
88 | } |
89 | } |
90 | impl Default for StreamPipeOptions { |
91 | fn default() -> Self { |
92 | Self::new() |
93 | } |
94 | } |
95 | |