pub trait EntityKind:
'static
+ Send
+ Sync {
type DefaultBundle: Bundle + Default;
type Bundle: Bundle;
// Required methods
unsafe fn from_entity_unchecked(entity: Entity) -> Self;
fn entity(&self) -> Entity;
}Expand description
Some kind of an Entity with an expected set of components.
Required Associated Types§
Sourcetype DefaultBundle: Bundle + Default
type DefaultBundle: Bundle + Default
A Bundle of components created and inserted by default into all entities with this EntityKind.
Sourcetype Bundle: Bundle
type Bundle: Bundle
A Bundle of components inserted into all entities with this EntityKind.
Required Methods§
Sourceunsafe fn from_entity_unchecked(entity: Entity) -> Self
unsafe fn from_entity_unchecked(entity: Entity) -> Self
Creates a new Entity with this EntityKind.
§Safety
This function assumes entity has all the components associated with this EntityKind.
Sourcefn entity(&self) -> Entity
fn entity(&self) -> Entity
Returns this EntityKind as a generic Entity.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.