pub struct ComponentManager<T: Component> { /* private fields */ }
Implementations§
Source§impl<T: Component> ComponentManager<T>
impl<T: Component> ComponentManager<T>
pub fn new() -> Self
pub fn has(&self, entity_id: usize) -> bool
pub fn add(&mut self, entity_id: usize, component: T)
pub fn remove(&mut self, entity_id: usize)
pub fn borrow_component(&self, entity_id: usize) -> Option<&T>
pub fn borrow_component_mut(&mut self, entity_id: usize) -> Option<&mut T>
pub fn borrow_entity_ids(&self) -> &Vec<usize>
pub fn borrow_components(&self) -> &Vec<T>
pub fn borrow_components_mut(&mut self) -> &mut Vec<T>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ComponentManager<T>
impl<T> RefUnwindSafe for ComponentManager<T>where
T: RefUnwindSafe,
impl<T> Send for ComponentManager<T>where
T: Send,
impl<T> Sync for ComponentManager<T>where
T: Sync,
impl<T> Unpin for ComponentManager<T>where
T: Unpin,
impl<T> UnwindSafe for ComponentManager<T>where
T: UnwindSafe,
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