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
use webapi::element::{Element, IElement};
use webapi::event_target::{EventTarget, IEventTarget};
use webapi::html_element::{HtmlElement, IHtmlElement};
use webapi::node::{INode, Node};
use webcore::try_from::TryInto;
use webcore::value::Reference;
#[derive(Clone, Debug, PartialEq, Eq, ReferenceType)]
#[reference(instance_of = "HTMLOptionElement")]
#[reference(subclass_of(EventTarget, Node, Element, HtmlElement))]
pub struct OptionElement(Reference);
impl IEventTarget for OptionElement {}
impl INode for OptionElement {}
impl IElement for OptionElement {}
impl IHtmlElement for OptionElement {}
impl OptionElement {
pub fn index(&self) -> i32 {
js!(
return @{self}.index;
).try_into().unwrap()
}
pub fn value(&self) -> String {
js!(
return @{self}.value;
).try_into().unwrap()
}
}