entity/
lib.rs

1#![forbid(unsafe_code)]
2
3mod alloc;
4mod any;
5mod database;
6mod ent;
7pub mod global;
8
9pub use alloc::{Id, IdAllocator, EPHEMERAL_ID};
10pub use any::*;
11pub use database::*;
12pub use ent::*;
13
14#[cfg(feature = "macros")]
15pub use entity_macros::*;
16
17/// Vendor module to re-expose relevant libraries
18pub mod vendor {
19    /// Re-exported macros, useful only to [`entity_macros`] crate
20    pub mod macros {
21        /// Re-export of serde
22        pub mod serde {
23            /// Indicates whether or not the included serde derive macros are
24            /// the result of the feature existing (true) or a no-op (false)
25            #[inline]
26            pub const fn exists() -> bool {
27                cfg!(feature = "serde-1")
28            }
29
30            #[cfg(feature = "serde-1")]
31            pub use ::serde::Serialize;
32
33            #[cfg(feature = "serde-1")]
34            pub use ::serde::Deserialize;
35
36            #[cfg(not(feature = "serde-1"))]
37            pub use ::entity_noop_macros::NoopDeriveSerde as Serialize;
38
39            #[cfg(not(feature = "serde-1"))]
40            pub use ::entity_noop_macros::NoopDeriveSerde as Deserialize;
41        }
42
43        /// Re-export of typetag
44        pub mod typetag {
45            /// Indicates whether or not the included typetag attr macro is the
46            /// result of the feature existing (true) or a no-op (false)
47            #[inline]
48            pub const fn exists() -> bool {
49                cfg!(feature = "typetag")
50            }
51
52            #[cfg(feature = "typetag")]
53            pub use ::typetag::serde;
54
55            #[cfg(not(feature = "typetag"))]
56            pub use ::entity_noop_macros::noop_attr as serde;
57        }
58    }
59}