diff options
Diffstat (limited to 'mingling_core')
| -rw-r--r-- | mingling_core/src/asset.rs | 3 | ||||
| -rw-r--r-- | mingling_core/src/asset/enum_tag.rs | 11 | ||||
| -rw-r--r-- | mingling_core/src/lib.rs | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/mingling_core/src/asset.rs b/mingling_core/src/asset.rs index 1270a50..a4254ef 100644 --- a/mingling_core/src/asset.rs +++ b/mingling_core/src/asset.rs @@ -9,6 +9,9 @@ pub mod comp; pub mod dispatcher; #[doc(hidden)] +pub mod enum_tag; + +#[doc(hidden)] pub mod node; #[doc(hidden)] diff --git a/mingling_core/src/asset/enum_tag.rs b/mingling_core/src/asset/enum_tag.rs new file mode 100644 index 0000000..563d826 --- /dev/null +++ b/mingling_core/src/asset/enum_tag.rs @@ -0,0 +1,11 @@ +/// Marker trait for EnumTag +pub trait EnumTag { + /// Get the name and description of this enum + fn enum_info(&self) -> (&'static str, &'static str); + + /// Get all possible enum variant names and descriptions + fn enums() -> &'static [(&'static str, &'static str)]; + + /// Build the enum from a name + fn build_enum(name: String) -> Self; +} diff --git a/mingling_core/src/lib.rs b/mingling_core/src/lib.rs index 2c5cf55..87be806 100644 --- a/mingling_core/src/lib.rs +++ b/mingling_core/src/lib.rs @@ -24,6 +24,7 @@ pub use crate::asset::chain::*; #[cfg(feature = "comp")] pub use crate::asset::comp::*; pub use crate::asset::dispatcher::*; +pub use crate::asset::enum_tag::*; pub use crate::asset::node::*; pub use crate::asset::renderer::*; |
