web_sys/features/
gen_TcpServerSocket.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = TCPServerSocket , typescript_type = "TCPServerSocket")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `TcpServerSocket` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `TcpServerSocket`*"]
14 pub type TcpServerSocket;
15 # [wasm_bindgen (structural , method , getter , js_class = "TCPServerSocket" , js_name = localPort)]
16 #[doc = "Getter for the `localPort` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket/localPort)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `TcpServerSocket`*"]
21 pub fn local_port(this: &TcpServerSocket) -> u16;
22 # [wasm_bindgen (structural , method , getter , js_class = "TCPServerSocket" , js_name = onconnect)]
23 #[doc = "Getter for the `onconnect` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket/onconnect)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `TcpServerSocket`*"]
28 pub fn onconnect(this: &TcpServerSocket) -> Option<::js_sys::Function>;
29 # [wasm_bindgen (structural , method , setter , js_class = "TCPServerSocket" , js_name = onconnect)]
30 #[doc = "Setter for the `onconnect` field of this object."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket/onconnect)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `TcpServerSocket`*"]
35 pub fn set_onconnect(this: &TcpServerSocket, value: Option<&::js_sys::Function>);
36 # [wasm_bindgen (structural , method , getter , js_class = "TCPServerSocket" , js_name = onerror)]
37 #[doc = "Getter for the `onerror` field of this object."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket/onerror)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `TcpServerSocket`*"]
42 pub fn onerror(this: &TcpServerSocket) -> Option<::js_sys::Function>;
43 # [wasm_bindgen (structural , method , setter , js_class = "TCPServerSocket" , js_name = onerror)]
44 #[doc = "Setter for the `onerror` field of this object."]
45 #[doc = ""]
46 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket/onerror)"]
47 #[doc = ""]
48 #[doc = "*This API requires the following crate features to be activated: `TcpServerSocket`*"]
49 pub fn set_onerror(this: &TcpServerSocket, value: Option<&::js_sys::Function>);
50 #[wasm_bindgen(catch, constructor, js_class = "TCPServerSocket")]
51 #[doc = "The `new TcpServerSocket(..)` constructor, creating a new instance of `TcpServerSocket`."]
52 #[doc = ""]
53 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket/TCPServerSocket)"]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `TcpServerSocket`*"]
56 pub fn new(port: u16) -> Result<TcpServerSocket, JsValue>;
57 #[cfg(feature = "ServerSocketOptions")]
58 #[wasm_bindgen(catch, constructor, js_class = "TCPServerSocket")]
59 #[doc = "The `new TcpServerSocket(..)` constructor, creating a new instance of `TcpServerSocket`."]
60 #[doc = ""]
61 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket/TCPServerSocket)"]
62 #[doc = ""]
63 #[doc = "*This API requires the following crate features to be activated: `ServerSocketOptions`, `TcpServerSocket`*"]
64 pub fn new_with_options(
65 port: u16,
66 options: &ServerSocketOptions,
67 ) -> Result<TcpServerSocket, JsValue>;
68 #[cfg(feature = "ServerSocketOptions")]
69 #[wasm_bindgen(catch, constructor, js_class = "TCPServerSocket")]
70 #[doc = "The `new TcpServerSocket(..)` constructor, creating a new instance of `TcpServerSocket`."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket/TCPServerSocket)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `ServerSocketOptions`, `TcpServerSocket`*"]
75 pub fn new_with_options_and_backlog(
76 port: u16,
77 options: &ServerSocketOptions,
78 backlog: u16,
79 ) -> Result<TcpServerSocket, JsValue>;
80 # [wasm_bindgen (method , structural , js_class = "TCPServerSocket" , js_name = close)]
81 #[doc = "The `close()` method."]
82 #[doc = ""]
83 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TCPServerSocket/close)"]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `TcpServerSocket`*"]
86 pub fn close(this: &TcpServerSocket);
87}