1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
use super::*;
/// The NavigationHistoryEntry class.
/// [`NavigationHistoryEntry`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry)
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct NavigationHistoryEntry {
inner: EventTarget,
}
impl FromVal for NavigationHistoryEntry {
fn from_val(v: &Any) -> Self {
NavigationHistoryEntry {
inner: EventTarget::from_val(v),
}
}
fn take_ownership(v: AnyHandle) -> Self {
Self::from_val(&Any::take_ownership(v))
}
fn as_handle(&self) -> AnyHandle {
self.inner.as_handle()
}
}
impl core::ops::Deref for NavigationHistoryEntry {
type Target = EventTarget;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for NavigationHistoryEntry {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for NavigationHistoryEntry {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for NavigationHistoryEntry {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<NavigationHistoryEntry> for Any {
fn from(s: NavigationHistoryEntry) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&NavigationHistoryEntry> for Any {
fn from(s: &NavigationHistoryEntry) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(NavigationHistoryEntry);
impl NavigationHistoryEntry {
/// Getter of the `url` attribute.
/// [`NavigationHistoryEntry.url`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/url)
pub fn url(&self) -> JsString {
self.inner.get("url").as_::<JsString>()
}
}
impl NavigationHistoryEntry {
/// Getter of the `key` attribute.
/// [`NavigationHistoryEntry.key`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/key)
pub fn key(&self) -> JsString {
self.inner.get("key").as_::<JsString>()
}
}
impl NavigationHistoryEntry {
/// Getter of the `id` attribute.
/// [`NavigationHistoryEntry.id`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/id)
pub fn id(&self) -> JsString {
self.inner.get("id").as_::<JsString>()
}
}
impl NavigationHistoryEntry {
/// Getter of the `index` attribute.
/// [`NavigationHistoryEntry.index`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/index)
pub fn index(&self) -> i64 {
self.inner.get("index").as_::<i64>()
}
}
impl NavigationHistoryEntry {
/// Getter of the `sameDocument` attribute.
/// [`NavigationHistoryEntry.sameDocument`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/sameDocument)
pub fn same_document(&self) -> bool {
self.inner.get("sameDocument").as_::<bool>()
}
}
impl NavigationHistoryEntry {
/// Getter of the `ondispose` attribute.
/// [`NavigationHistoryEntry.ondispose`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/ondispose)
pub fn ondispose(&self) -> Any {
self.inner.get("ondispose").as_::<Any>()
}
/// Setter of the `ondispose` attribute.
/// [`NavigationHistoryEntry.ondispose`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/ondispose)
pub fn set_ondispose(&mut self, value: &Any) {
self.inner.set("ondispose", value);
}
}
impl NavigationHistoryEntry {
/// The getState method.
/// [`NavigationHistoryEntry.getState`](https://developer.mozilla.org/en-US/docs/Web/API/NavigationHistoryEntry/getState)
pub fn get_state(&self) -> Any {
self.inner.call("getState", &[]).as_::<Any>()
}
}