Trait shard_ecs::descriptors::component::Component
source · pub trait Component: Send + Sync + Sized + 'static {
const NAME: &'static str;
const ID: ComponentTypeId = _;
const DESCRIPTOR: ComponentDescriptor = _;
}
Expand description
Implement this trait to use a type as a component in the ECS.
Do not override the default implementations for Self::ID
or Self::DESCRIPTOR
.
Only implement Self::NAME
.
Safety:
- size_of
must not exceed u16::MAX. - align_of
must not exceed u16::MAX.
Required Associated Constants
Provided Associated Constants
sourceconst ID: ComponentTypeId = _
const ID: ComponentTypeId = _
Do not implement this manually. (Unless a hash collision occurs).
sourceconst DESCRIPTOR: ComponentDescriptor = _
const DESCRIPTOR: ComponentDescriptor = _
A descriptor defining the component type.