Skip to main content

web_sys/features/
gen_TcpServerSocket.rs

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