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