| 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 = 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 | #[doc = "Get the `preventAbort` field of this object." ] |
| 14 | #[doc = "" ] |
| 15 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
| 16 | #[wasm_bindgen (method, getter = "preventAbort" )] |
| 17 | pub unsafefn get_prevent_abort(this: &StreamPipeOptions) -> Option<bool>; |
| 18 | #[doc = "Change the `preventAbort` field of this object." ] |
| 19 | #[doc = "" ] |
| 20 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
| 21 | #[wasm_bindgen (method, setter = "preventAbort" )] |
| 22 | pub unsafefn set_prevent_abort(this: &StreamPipeOptions, val: bool); |
| 23 | #[doc = "Get the `preventCancel` field of this object." ] |
| 24 | #[doc = "" ] |
| 25 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
| 26 | #[wasm_bindgen (method, getter = "preventCancel" )] |
| 27 | pub unsafefn get_prevent_cancel(this: &StreamPipeOptions) -> Option<bool>; |
| 28 | #[doc = "Change the `preventCancel` field of this object." ] |
| 29 | #[doc = "" ] |
| 30 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
| 31 | #[wasm_bindgen (method, setter = "preventCancel" )] |
| 32 | pub unsafefn set_prevent_cancel(this: &StreamPipeOptions, val: bool); |
| 33 | #[doc = "Get the `preventClose` field of this object." ] |
| 34 | #[doc = "" ] |
| 35 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
| 36 | #[wasm_bindgen (method, getter = "preventClose" )] |
| 37 | pub unsafefn get_prevent_close(this: &StreamPipeOptions) -> Option<bool>; |
| 38 | #[doc = "Change the `preventClose` field of this object." ] |
| 39 | #[doc = "" ] |
| 40 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
| 41 | #[wasm_bindgen (method, setter = "preventClose" )] |
| 42 | pub unsafefn set_prevent_close(this: &StreamPipeOptions, val: bool); |
| 43 | #[cfg (feature = "AbortSignal" )] |
| 44 | #[doc = "Get the `signal` field of this object." ] |
| 45 | #[doc = "" ] |
| 46 | #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `StreamPipeOptions`*" ] |
| 47 | #[wasm_bindgen (method, getter = "signal" )] |
| 48 | pub unsafefn get_signal(this: &StreamPipeOptions) -> Option<AbortSignal>; |
| 49 | #[cfg (feature = "AbortSignal" )] |
| 50 | #[doc = "Change the `signal` field of this object." ] |
| 51 | #[doc = "" ] |
| 52 | #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `StreamPipeOptions`*" ] |
| 53 | #[wasm_bindgen (method, setter = "signal" )] |
| 54 | pub unsafefn set_signal(this: &StreamPipeOptions, val: &AbortSignal); |
| 55 | } |
| 56 | impl StreamPipeOptions { |
| 57 | #[doc = "Construct a new `StreamPipeOptions`." ] |
| 58 | #[doc = "" ] |
| 59 | #[doc = "*This API requires the following crate features to be activated: `StreamPipeOptions`*" ] |
| 60 | pub fn new() -> Self { |
| 61 | #[allow (unused_mut)] |
| 62 | let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); |
| 63 | ret |
| 64 | } |
| 65 | #[deprecated = "Use `set_prevent_abort()` instead." ] |
| 66 | pub fn prevent_abort(&mut self, val: bool) -> &mut Self { |
| 67 | self.set_prevent_abort(val); |
| 68 | self |
| 69 | } |
| 70 | #[deprecated = "Use `set_prevent_cancel()` instead." ] |
| 71 | pub fn prevent_cancel(&mut self, val: bool) -> &mut Self { |
| 72 | self.set_prevent_cancel(val); |
| 73 | self |
| 74 | } |
| 75 | #[deprecated = "Use `set_prevent_close()` instead." ] |
| 76 | pub fn prevent_close(&mut self, val: bool) -> &mut Self { |
| 77 | self.set_prevent_close(val); |
| 78 | self |
| 79 | } |
| 80 | #[cfg (feature = "AbortSignal" )] |
| 81 | #[deprecated = "Use `set_signal()` instead." ] |
| 82 | pub fn signal(&mut self, val: &AbortSignal) -> &mut Self { |
| 83 | self.set_signal(val); |
| 84 | self |
| 85 | } |
| 86 | } |
| 87 | impl Default for StreamPipeOptions { |
| 88 | fn default() -> Self { |
| 89 | Self::new() |
| 90 | } |
| 91 | } |
| 92 | |