Struct bevy_ecs::component::ComponentInfo
source · pub struct ComponentInfo { /* private fields */ }
Implementations§
source§impl ComponentInfo
impl ComponentInfo
pub fn id(&self) -> ComponentId
pub fn name(&self) -> &str
pub fn type_id(&self) -> Option<TypeId>
pub fn layout(&self) -> Layout
sourcepub fn drop(&self) -> Option<unsafe fn(_: OwningPtr<'_>)>
pub fn drop(&self) -> Option<unsafe fn(_: OwningPtr<'_>)>
Get the function which should be called to clean up values of
the underlying component type. This maps to the
Drop
implementation for ‘normal’ Rust components
Returns None
if values of the underlying component type don’t
need to be dropped, e.g. as reported by needs_drop
.
pub fn storage_type(&self) -> StorageType
pub fn is_send_and_sync(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ComponentInfo
impl Send for ComponentInfo
impl Sync for ComponentInfo
impl Unpin for ComponentInfo
impl UnwindSafe for ComponentInfo
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.