[−][src]Struct tiny_ecs::ComponentMap
ComponentMap
is a container type for the components used by entities
Methods
impl<T> ComponentMap<T>
[src]
pub fn get_part_ref(&self, id: usize) -> Result<&T, ECSError>
[src]
Getting a reference to an entity part requires the entity ID
pub fn get_part_mut(&mut self, id: usize) -> Result<&mut T, ECSError>
[src]
Getting a mutable reference to an entity part requires the entity ID
Example
#[derive(Debug, PartialEq)] struct Test1 {} let components = entities.borrow::<Test1>().unwrap(); let part = components.get_part_ref(entity_1).unwrap(); assert_eq!(part, &Test1 {}); // or let part = components.get_part_ref(entity_1).unwrap(); assert_eq!(part, &Test1 {});
pub fn get(&self) -> &VecMap<T>
[src]
Returns a borrow of the inner hashmap of components
pub fn get_mut(&mut self) -> &mut VecMap<T>
[src]
Returns a mutable borrow of the inner hashmap of components
Trait Implementations
Auto Trait Implementations
impl<T> Send for ComponentMap<T> where
T: Send,
T: Send,
impl<T> Unpin for ComponentMap<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for ComponentMap<T> where
T: Sync,
T: Sync,
impl<T> UnwindSafe for ComponentMap<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for ComponentMap<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,