Struct oxygengine_core::ecs::TypeInfo [−][src]
pub struct TypeInfo { /* fields omitted */ }
Expand description
Metadata required to store a component.
All told, this means a TypeId
, to be able to dynamically name/check the component type; a
Layout
, so that we know how to allocate memory for this component type; and a drop function
which internally calls core::ptr::drop_in_place
with the correct type parameter.
Implementations
Construct a TypeInfo
directly from the static type.
Construct a TypeInfo
from its components. This is useful in the rare case that you have
some kind of pointer to raw bytes/erased memory holding a component type, coming from a
source unrelated to hecs, and you want to treat it as an insertable component by
implementing the DynamicBundle
API.
Directly call the destructor on a pointer to data of this component type.
Safety
All of the caveats of core::ptr::drop_in_place
apply, with the additional requirement
that this method is being called on a pointer to an object of the correct component type.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for TypeInfo
impl UnwindSafe for TypeInfo
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.