Struct bones_lib::ecs::components::ComponentStores
pub struct ComponentStores { /* private fields */ }
Expand description
A collection of ComponentStore<T>
.
ComponentStores
is used to in World
to store all component types that have been
initialized for that world.
Implementations§
§impl ComponentStores
impl ComponentStores
pub fn get_cell<T>(&self) -> Arc<AtomicCell<ComponentStore<T>>>where
T: HasSchema,
pub fn get_cell<T>(&self) -> Arc<AtomicCell<ComponentStore<T>>>where
T: HasSchema,
Get the components of a certain type
pub fn get<T>(&self) -> &AtomicCell<ComponentStore<T>>where
T: HasSchema,
pub fn get<T>(&self) -> &AtomicCell<ComponentStore<T>>where
T: HasSchema,
pub fn get_by_schema(
&self,
schema: &'static Schema,
) -> &AtomicCell<UntypedComponentStore>
pub fn get_by_schema( &self, schema: &'static Schema, ) -> &AtomicCell<UntypedComponentStore>
Get the untyped component storage by the component’s SchemaId
.
pub fn get_cell_by_schema(
&self,
schema: &'static Schema,
) -> Arc<AtomicCell<UntypedComponentStore>>
pub fn get_cell_by_schema( &self, schema: &'static Schema, ) -> Arc<AtomicCell<UntypedComponentStore>>
Get the untyped component storage by the component’s SchemaId
.
Trait Implementations§
§impl Clone for ComponentStores
impl Clone for ComponentStores
§fn clone(&self) -> ComponentStores
fn clone(&self) -> ComponentStores
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Default for ComponentStores
impl Default for ComponentStores
§fn default() -> ComponentStores
fn default() -> ComponentStores
Returns the “default value” for a type. Read more
impl Send for ComponentStores
impl Sync for ComponentStores
Auto Trait Implementations§
impl Freeze for ComponentStores
impl !RefUnwindSafe for ComponentStores
impl Unpin for ComponentStores
impl !UnwindSafe for ComponentStores
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &World) -> T
fn from_world(_world: &World) -> T
Creates
Self
using data from the given World
.