pub struct ComponentInfo { /* private fields */ }
Expand description
Stores metadata for a type of component or resource stored in a specific World
.
Implementations§
Source§impl ComponentInfo
impl ComponentInfo
Sourcepub fn id(&self) -> ComponentId
pub fn id(&self) -> ComponentId
Returns a value uniquely identifying the current component.
Sourcepub 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.
Sourcepub fn layout(&self) -> Layout
pub fn layout(&self) -> Layout
Returns the layout used to store values of this component in memory.
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
.
Sourcepub fn storage_type(&self) -> StorageType
pub fn storage_type(&self) -> StorageType
Returns a value indicating the storage strategy for the current component.
Sourcepub 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.
Sourcepub fn hooks(&self) -> &ComponentHooks
pub fn hooks(&self) -> &ComponentHooks
Provides a reference to the collection of hooks associated with this Component
Trait Implementations§
Source§impl Clone for ComponentInfo
impl Clone for ComponentInfo
Source§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 more