web_sys/features/
gen_PositionOptions.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 = PositionOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `PositionOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"]
12    pub type PositionOptions;
13    #[doc = "Get the `enableHighAccuracy` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"]
16    #[wasm_bindgen(method, getter = "enableHighAccuracy")]
17    pub fn get_enable_high_accuracy(this: &PositionOptions) -> Option<bool>;
18    #[doc = "Change the `enableHighAccuracy` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"]
21    #[wasm_bindgen(method, setter = "enableHighAccuracy")]
22    pub fn set_enable_high_accuracy(this: &PositionOptions, val: bool);
23    #[doc = "Get the `maximumAge` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"]
26    #[wasm_bindgen(method, getter = "maximumAge")]
27    pub fn get_maximum_age(this: &PositionOptions) -> Option<u32>;
28    #[doc = "Change the `maximumAge` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"]
31    #[wasm_bindgen(method, setter = "maximumAge")]
32    pub fn set_maximum_age(this: &PositionOptions, val: u32);
33    #[doc = "Get the `timeout` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"]
36    #[wasm_bindgen(method, getter = "timeout")]
37    pub fn get_timeout(this: &PositionOptions) -> Option<u32>;
38    #[doc = "Change the `timeout` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"]
41    #[wasm_bindgen(method, setter = "timeout")]
42    pub fn set_timeout(this: &PositionOptions, val: u32);
43}
44impl PositionOptions {
45    #[doc = "Construct a new `PositionOptions`."]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `PositionOptions`*"]
48    pub fn new() -> Self {
49        #[allow(unused_mut)]
50        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
51        ret
52    }
53    #[deprecated = "Use `set_enable_high_accuracy()` instead."]
54    pub fn enable_high_accuracy(&mut self, val: bool) -> &mut Self {
55        self.set_enable_high_accuracy(val);
56        self
57    }
58    #[deprecated = "Use `set_maximum_age()` instead."]
59    pub fn maximum_age(&mut self, val: u32) -> &mut Self {
60        self.set_maximum_age(val);
61        self
62    }
63    #[deprecated = "Use `set_timeout()` instead."]
64    pub fn timeout(&mut self, val: u32) -> &mut Self {
65        self.set_timeout(val);
66        self
67    }
68}
69impl Default for PositionOptions {
70    fn default() -> Self {
71        Self::new()
72    }
73}