1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#![forbid(unsafe_code)]

mod alloc;
mod any;
mod database;
mod ent;
pub mod global;

pub use alloc::{Id, IdAllocator, EPHEMERAL_ID};
pub use any::*;
pub use database::*;
pub use ent::*;

#[cfg(feature = "macros")]
pub use entity_macros::*;

/// Vendor module to re-expose relevant libraries
pub mod vendor {
    /// Re-exported macros, useful only to [`entity_macros`] crate
    pub mod macros {
        /// Re-export of serde
        pub mod serde {
            /// Indicates whether or not the included serde derive macros are
            /// the result of the feature existing (true) or a no-op (false)
            #[inline]
            pub const fn exists() -> bool {
                cfg!(feature = "serde-1")
            }

            #[cfg(feature = "serde-1")]
            pub use ::serde::Serialize;

            #[cfg(feature = "serde-1")]
            pub use ::serde::Deserialize;

            #[cfg(not(feature = "serde-1"))]
            pub use ::entity_noop_macros::NoopDeriveSerde as Serialize;

            #[cfg(not(feature = "serde-1"))]
            pub use ::entity_noop_macros::NoopDeriveSerde as Deserialize;
        }

        /// Re-export of typetag
        pub mod typetag {
            /// Indicates whether or not the included typetag attr macro is the
            /// result of the feature existing (true) or a no-op (false)
            #[inline]
            pub const fn exists() -> bool {
                cfg!(feature = "typetag")
            }

            #[cfg(feature = "typetag")]
            pub use ::typetag::serde;

            #[cfg(not(feature = "typetag"))]
            pub use ::entity_noop_macros::noop_attr as serde;
        }
    }
}