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