web_sys/features/
gen_DnsCacheEntry.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 = DnsCacheEntry)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `DnsCacheEntry` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
12 pub type DnsCacheEntry;
13 #[doc = "Get the `expiration` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
16 #[wasm_bindgen(method, getter = "expiration")]
17 pub fn get_expiration(this: &DnsCacheEntry) -> Option<f64>;
18 #[doc = "Change the `expiration` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
21 #[wasm_bindgen(method, setter = "expiration")]
22 pub fn set_expiration(this: &DnsCacheEntry, val: f64);
23 #[doc = "Get the `family` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
26 #[wasm_bindgen(method, getter = "family")]
27 pub fn get_family(this: &DnsCacheEntry) -> Option<::alloc::string::String>;
28 #[doc = "Change the `family` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
31 #[wasm_bindgen(method, setter = "family")]
32 pub fn set_family(this: &DnsCacheEntry, val: &str);
33 #[doc = "Get the `hostaddr` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
36 #[wasm_bindgen(method, getter = "hostaddr")]
37 pub fn get_hostaddr(this: &DnsCacheEntry) -> Option<::js_sys::Array>;
38 #[doc = "Change the `hostaddr` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
41 #[wasm_bindgen(method, setter = "hostaddr")]
42 pub fn set_hostaddr(this: &DnsCacheEntry, val: &::wasm_bindgen::JsValue);
43 #[doc = "Get the `hostname` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
46 #[wasm_bindgen(method, getter = "hostname")]
47 pub fn get_hostname(this: &DnsCacheEntry) -> Option<::alloc::string::String>;
48 #[doc = "Change the `hostname` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
51 #[wasm_bindgen(method, setter = "hostname")]
52 pub fn set_hostname(this: &DnsCacheEntry, val: &str);
53 #[doc = "Get the `trr` field of this object."]
54 #[doc = ""]
55 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
56 #[wasm_bindgen(method, getter = "trr")]
57 pub fn get_trr(this: &DnsCacheEntry) -> Option<bool>;
58 #[doc = "Change the `trr` field of this object."]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
61 #[wasm_bindgen(method, setter = "trr")]
62 pub fn set_trr(this: &DnsCacheEntry, val: bool);
63}
64impl DnsCacheEntry {
65 #[doc = "Construct a new `DnsCacheEntry`."]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `DnsCacheEntry`*"]
68 pub fn new() -> Self {
69 #[allow(unused_mut)]
70 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
71 ret
72 }
73 #[deprecated = "Use `set_expiration()` instead."]
74 pub fn expiration(&mut self, val: f64) -> &mut Self {
75 self.set_expiration(val);
76 self
77 }
78 #[deprecated = "Use `set_family()` instead."]
79 pub fn family(&mut self, val: &str) -> &mut Self {
80 self.set_family(val);
81 self
82 }
83 #[deprecated = "Use `set_hostaddr()` instead."]
84 pub fn hostaddr(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self {
85 self.set_hostaddr(val);
86 self
87 }
88 #[deprecated = "Use `set_hostname()` instead."]
89 pub fn hostname(&mut self, val: &str) -> &mut Self {
90 self.set_hostname(val);
91 self
92 }
93 #[deprecated = "Use `set_trr()` instead."]
94 pub fn trr(&mut self, val: bool) -> &mut Self {
95 self.set_trr(val);
96 self
97 }
98}
99impl Default for DnsCacheEntry {
100 fn default() -> Self {
101 Self::new()
102 }
103}