gir_parser/
virtual_method.rs1use xmlserde_derives::XmlDeserialize;
2
3use crate::{
4 attribute::Attribute,
5 documentation::{DocDeprecated, DocStability, DocVersion, Documentation, SourcePosition},
6 parameter::Parameters,
7 prelude::*,
8 return_value::ReturnValue,
9 version::Version,
10 Stability,
11};
12
13#[derive(Clone, Debug, XmlDeserialize)]
14#[xmlserde(root = b"virtual-method")]
15#[xmlserde(deny_unknown_fields)]
16pub struct VirtualMethod {
17 #[xmlserde(name = b"invoker", ty = "attr")]
18 invoker: Option<String>,
19 #[xmlserde(name = b"glib:static", ty = "attr")]
20 is_static: Option<bool>,
21 #[xmlserde(name = b"name", ty = "attr")]
23 name: String,
24 #[xmlserde(name = b"c:identifier", ty = "attr")]
25 c_identifier: Option<String>,
26 #[xmlserde(name = b"shadows", ty = "attr")]
27 shadows: Option<String>,
28 #[xmlserde(name = b"shadowed-by", ty = "attr")]
29 shadowed_by: Option<String>,
30 #[xmlserde(name = b"throws", ty = "attr")]
31 throws: Option<bool>,
32 #[xmlserde(name = b"moved-to", ty = "attr")]
33 moved_to: Option<String>,
34 #[xmlserde(name = b"glib:async-func", ty = "attr")]
35 async_func: Option<String>,
36 #[xmlserde(name = b"glib:finish-func", ty = "attr")]
37 finish_func: Option<String>,
38 #[xmlserde(name = b"glib:sync-func", ty = "attr")]
39 sync_func: Option<String>,
40 #[xmlserde(name = b"introspectable", ty = "attr")]
42 introspectable: Option<bool>,
43 #[xmlserde(name = b"deprecated", ty = "attr")]
44 deprecated: Option<bool>,
45 #[xmlserde(name = b"version", ty = "attr")]
46 version: Option<Version>,
47 #[xmlserde(name = b"deprecated-version", ty = "attr")]
48 deprecated_version: Option<Version>,
49 #[xmlserde(name = b"stability", ty = "attr")]
50 stability: Option<Stability>,
51 #[xmlserde(name = b"doc", ty = "child")]
53 doc: Option<Documentation>,
54 #[xmlserde(name = b"doc-deprecated", ty = "child")]
55 doc_deprecated: Option<DocDeprecated>,
56 #[xmlserde(name = b"doc-stability", ty = "child")]
57 doc_stability: Option<DocStability>,
58 #[xmlserde(name = b"doc-version", ty = "child")]
59 doc_version: Option<DocVersion>,
60 #[xmlserde(name = b"source-position", ty = "child")]
61 source_position: Option<SourcePosition>,
62 #[xmlserde(name = b"attribute", ty = "child")]
64 attributes: Vec<Attribute>,
65
66 #[xmlserde(name = b"return-value", ty = "child")]
67 return_value: ReturnValue,
68 #[xmlserde(name = b"parameters", ty = "child", default = "Parameters::default")]
69 parameters: Parameters,
70}
71
72impl VirtualMethod {
73 pub fn invoker(&self) -> Option<&str> {
74 self.invoker.as_deref()
75 }
76
77 pub fn is_static(&self) -> Option<bool> {
78 self.is_static
79 }
80}
81
82impl_info!(VirtualMethod);
83impl_attributable!(VirtualMethod);
84impl_documentable!(VirtualMethod);
85impl_callable!(VirtualMethod);
86impl_function_like!(VirtualMethod);