gtk_ui_builder/ast/
entry.rs

1use super::entries::prelude::*;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
4pub enum Entry {
5    Root(Root),
6    Object(Object),
7    Property(Property),
8
9    #[cfg(feature = "rhai-events")]
10    RhaiEvent(RhaiEvent)
11}
12
13impl Entry {
14    pub fn dbg(&self) -> String {
15        match self {
16            Self::Root(obj) => obj.dbg(),
17            Self::Object(obj) => obj.dbg(),
18            Self::Property(obj) => obj.dbg(),
19
20            #[cfg(feature = "rhai-events")]
21            Self::RhaiEvent(obj) => obj.dbg()
22        }
23    }
24
25    pub fn get_xml(&self) -> String {
26        match self {
27            Self::Root(obj) => obj.get_xml(),
28            Self::Object(obj) => obj.get_xml(),
29            Self::Property(obj) => obj.get_xml(),
30
31            #[cfg(feature = "rhai-events")]
32            Self::RhaiEvent(obj) => obj.get_xml()
33        }
34    }
35}