Struct bevy::ecs::component::ComponentInfo
pub struct ComponentInfo { /* private fields */ }
Expand description
Stores metadata for a type of component or resource stored in a specific World
.
Implementations§
§impl ComponentInfo
impl ComponentInfo
pub fn id(&self) -> ComponentId
pub fn id(&self) -> ComponentId
Returns a value uniquely identifying the current component.
pub fn type_id(&self) -> Option<TypeId>
pub fn type_id(&self) -> Option<TypeId>
Returns the TypeId
of the underlying component type.
Returns None
if the component does not correspond to a Rust type.
pub fn drop(&self) -> Option<unsafe fn(_: OwningPtr<'_, Aligned>)>
pub fn drop(&self) -> Option<unsafe fn(_: OwningPtr<'_, Aligned>)>
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 storage_type(&self) -> StorageType
Returns a value indicating the storage strategy for the current component.
pub fn is_send_and_sync(&self) -> bool
pub fn is_send_and_sync(&self) -> bool
Returns true
if the underlying component type can be freely shared between threads.
If this returns false
, then extra care must be taken to ensure that components
are not accessed from the wrong thread.
Trait Implementations§
§impl Clone for ComponentInfo
impl Clone for ComponentInfo
§fn clone(&self) -> ComponentInfo
fn clone(&self) -> ComponentInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for ComponentInfo
impl Send for ComponentInfo
impl Sync for ComponentInfo
impl Unpin for ComponentInfo
impl UnwindSafe for ComponentInfo
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.