Trait shipyard::Get [−][src]
Retrives components based on their type and entity id.
Associated Types
Loading content...Required methods
fn get(self, entity: EntityId) -> Result<Self::Out, MissingComponent>
[src]
Retrieve components of entity
.
Multiple components can be queried at the same time using a tuple.
Example:
use shipyard::{Get, View, World}; let mut world = World::new(); let entity = world.add_entity((0usize, 1u32)); let (usizes, u32s) = world.borrow::<(View<usize>, View<u32>)>().unwrap(); assert_eq!((&usizes, &u32s).get(entity), Ok((&0, &1)));
fn fast_get(self, entity: EntityId) -> Result<Self::FastOut, MissingComponent>
[src]
Retrieve components of entity
without fine modification tracking.
Multiple components can be queried at the same time using a tuple.
Example:
use shipyard::{Get, View, World}; let mut world = World::new(); let entity = world.add_entity((0usize, 1u32)); let (usizes, u32s) = world.borrow::<(View<usize>, View<u32>)>().unwrap(); assert_eq!((&usizes, &u32s).fast_get(entity), Ok((&0, &1)));