Trait entity::EntType [−][src]
pub trait EntType { fn type_data() -> EntTypeData; fn type_str() -> &'static str { ... } fn is_concrete_type() -> bool { ... } fn wrapped_tys() -> Option<HashSet<&'static str>> { ... } }
Represents the interface for an Ent to report its type. This should align
with [Ent::r#type()
] method and is used when we must know the type
without having an instance of an ent.
Required methods
fn type_data() -> EntTypeData
[src]
Represents data about the ent’s type
Provided methods
fn type_str() -> &'static str
[src]
Returns a static str that represents the unique type for an ent
fn is_concrete_type() -> bool
[src]
Indicates whether the ent represents a concrete type (like a struct) or a wrapper around one of many types (like an enum)
fn wrapped_tys() -> Option<HashSet<&'static str>>
[src]
Represents the types that this ent wraps if it is not a concrete ent
Implementors
impl EntType for UntypedEnt
[src]
fn type_data() -> EntTypeData
[src]
Represents a unique type associated with the entity, used for lookups, indexing by type, and conversions
Examples
use entity::{UntypedEnt, EntType, EntTypeData}; assert!(matches!( UntypedEnt::type_data(), EntTypeData::Concrete { ty: "entity::ent::UntypedEnt" }, ));