Skip to main content

web_sys/features/
gen_HighlightHitResult.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = HighlightHitResult)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `HighlightHitResult` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `HighlightHitResult`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type HighlightHitResult;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "Highlight")]
19    #[doc = "Get the `highlight` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `Highlight`, `HighlightHitResult`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    #[wasm_bindgen(method, getter = "highlight")]
26    pub fn get_highlight(this: &HighlightHitResult) -> Option<Highlight>;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "Highlight")]
29    #[doc = "Change the `highlight` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `Highlight`, `HighlightHitResult`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "highlight")]
36    pub fn set_highlight(this: &HighlightHitResult, val: &Highlight);
37    #[cfg(web_sys_unstable_apis)]
38    #[cfg(feature = "AbstractRange")]
39    #[doc = "Get the `ranges` field of this object."]
40    #[doc = ""]
41    #[doc = "*This API requires the following crate features to be activated: `AbstractRange`, `HighlightHitResult`*"]
42    #[doc = ""]
43    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
44    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
45    #[wasm_bindgen(method, getter = "ranges")]
46    pub fn get_ranges(this: &HighlightHitResult) -> Option<::js_sys::Array<AbstractRange>>;
47    #[cfg(web_sys_unstable_apis)]
48    #[cfg(feature = "AbstractRange")]
49    #[doc = "Change the `ranges` field of this object."]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `AbstractRange`, `HighlightHitResult`*"]
52    #[doc = ""]
53    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
54    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
55    #[wasm_bindgen(method, setter = "ranges")]
56    pub fn set_ranges(this: &HighlightHitResult, val: &[AbstractRange]);
57}
58#[cfg(web_sys_unstable_apis)]
59impl HighlightHitResult {
60    #[doc = "Construct a new `HighlightHitResult`."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `HighlightHitResult`*"]
63    #[doc = ""]
64    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
65    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
66    pub fn new() -> Self {
67        #[allow(unused_mut)]
68        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
69        ret
70    }
71    #[cfg(web_sys_unstable_apis)]
72    #[cfg(feature = "Highlight")]
73    #[deprecated = "Use `set_highlight()` instead."]
74    pub fn highlight(&mut self, val: &Highlight) -> &mut Self {
75        self.set_highlight(val);
76        self
77    }
78    #[cfg(web_sys_unstable_apis)]
79    #[cfg(feature = "AbstractRange")]
80    #[deprecated = "Use `set_ranges()` instead."]
81    pub fn ranges(&mut self, val: &[AbstractRange]) -> &mut Self {
82        self.set_ranges(val);
83        self
84    }
85}
86#[cfg(web_sys_unstable_apis)]
87impl Default for HighlightHitResult {
88    fn default() -> Self {
89        Self::new()
90    }
91}