web_sys/features/
gen_WebSocketElement.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 = WebSocketElement)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `WebSocketElement` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
12 pub type WebSocketElement;
13 #[doc = "Get the `encrypted` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
16 #[wasm_bindgen(method, getter = "encrypted")]
17 pub fn get_encrypted(this: &WebSocketElement) -> Option<bool>;
18 #[doc = "Change the `encrypted` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
21 #[wasm_bindgen(method, setter = "encrypted")]
22 pub fn set_encrypted(this: &WebSocketElement, val: bool);
23 #[doc = "Get the `hostport` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
26 #[wasm_bindgen(method, getter = "hostport")]
27 pub fn get_hostport(this: &WebSocketElement) -> Option<::alloc::string::String>;
28 #[doc = "Change the `hostport` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
31 #[wasm_bindgen(method, setter = "hostport")]
32 pub fn set_hostport(this: &WebSocketElement, val: &str);
33 #[doc = "Get the `msgreceived` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
36 #[wasm_bindgen(method, getter = "msgreceived")]
37 pub fn get_msgreceived(this: &WebSocketElement) -> Option<u32>;
38 #[doc = "Change the `msgreceived` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
41 #[wasm_bindgen(method, setter = "msgreceived")]
42 pub fn set_msgreceived(this: &WebSocketElement, val: u32);
43 #[doc = "Get the `msgsent` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
46 #[wasm_bindgen(method, getter = "msgsent")]
47 pub fn get_msgsent(this: &WebSocketElement) -> Option<u32>;
48 #[doc = "Change the `msgsent` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
51 #[wasm_bindgen(method, setter = "msgsent")]
52 pub fn set_msgsent(this: &WebSocketElement, val: u32);
53 #[doc = "Get the `receivedsize` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
56 #[wasm_bindgen(method, getter = "receivedsize")]
57 pub fn get_receivedsize(this: &WebSocketElement) -> Option<f64>;
58 #[doc = "Change the `receivedsize` field of this object."]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
61 #[wasm_bindgen(method, setter = "receivedsize")]
62 pub fn set_receivedsize(this: &WebSocketElement, val: f64);
63 #[doc = "Get the `sentsize` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
66 #[wasm_bindgen(method, getter = "sentsize")]
67 pub fn get_sentsize(this: &WebSocketElement) -> Option<f64>;
68 #[doc = "Change the `sentsize` field of this object."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
71 #[wasm_bindgen(method, setter = "sentsize")]
72 pub fn set_sentsize(this: &WebSocketElement, val: f64);
73}
74impl WebSocketElement {
75 #[doc = "Construct a new `WebSocketElement`."]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `WebSocketElement`*"]
78 pub fn new() -> Self {
79 #[allow(unused_mut)]
80 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
81 ret
82 }
83 #[deprecated = "Use `set_encrypted()` instead."]
84 pub fn encrypted(&mut self, val: bool) -> &mut Self {
85 self.set_encrypted(val);
86 self
87 }
88 #[deprecated = "Use `set_hostport()` instead."]
89 pub fn hostport(&mut self, val: &str) -> &mut Self {
90 self.set_hostport(val);
91 self
92 }
93 #[deprecated = "Use `set_msgreceived()` instead."]
94 pub fn msgreceived(&mut self, val: u32) -> &mut Self {
95 self.set_msgreceived(val);
96 self
97 }
98 #[deprecated = "Use `set_msgsent()` instead."]
99 pub fn msgsent(&mut self, val: u32) -> &mut Self {
100 self.set_msgsent(val);
101 self
102 }
103 #[deprecated = "Use `set_receivedsize()` instead."]
104 pub fn receivedsize(&mut self, val: f64) -> &mut Self {
105 self.set_receivedsize(val);
106 self
107 }
108 #[deprecated = "Use `set_sentsize()` instead."]
109 pub fn sentsize(&mut self, val: f64) -> &mut Self {
110 self.set_sentsize(val);
111 self
112 }
113}
114impl Default for WebSocketElement {
115 fn default() -> Self {
116 Self::new()
117 }
118}