summaryrefslogtreecommitdiff
path: root/engine-reflection/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine-reflection/src/lib.rs')
-rw-r--r--engine-reflection/src/lib.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/engine-reflection/src/lib.rs b/engine-reflection/src/lib.rs
index 5122cca..ef705a0 100644
--- a/engine-reflection/src/lib.rs
+++ b/engine-reflection/src/lib.rs
@@ -1,5 +1,6 @@
use std::alloc::Layout;
use std::any::{type_name, TypeId};
+use std::borrow::Cow;
use std::fmt::Debug;
/// Trait implemented by types that support runtime reflection on them.
@@ -81,6 +82,7 @@ pub struct StructField
pub type_id: TypeId,
pub type_name: &'static str,
pub get_type: FnWithDebug<Option<&'static Type>>,
+ pub visibility: Visibility,
}
impl StructField
@@ -149,6 +151,23 @@ pub enum LiteralType
Str,
}
+#[derive(Debug, Clone)]
+pub enum Visibility
+{
+ Pub,
+ PubScoped(VisibilityScope),
+ Private,
+}
+
+#[derive(Debug, Clone)]
+pub enum VisibilityScope
+{
+ Crate,
+ Super,
+ SelfModule,
+ In(Cow<'static, str>),
+}
+
macro_rules! impl_reflection_for_literals {
($(($literal_type: ident, $literal: ty)),*) => {
$(