web_sys/features/
gen_EventSourceInit.rs

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