pub struct ComponentData<C> { /* private fields */ }
Expand description
Storage for a single component type.
Implementations§
Source§impl<C> ComponentData<C>
impl<C> ComponentData<C>
Sourcepub fn new() -> ComponentData<C>
pub fn new() -> ComponentData<C>
Construct new empty ComponentData
instance.
Sourcepub fn get(&self, e: Entity) -> Option<&C>
pub fn get(&self, e: Entity) -> Option<&C>
Get a reference to a component only if it exists for this entity.
Trait Implementations§
Source§impl<C> AnyComponent for ComponentData<C>
impl<C> AnyComponent for ComponentData<C>
Source§impl<'a, C: Deserialize<'a>> Deserialize<'a> for ComponentData<C>
impl<'a, C: Deserialize<'a>> Deserialize<'a> for ComponentData<C>
Source§fn deserialize<D: Deserializer<'a>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'a>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<C> Index<Entity> for ComponentData<C>
impl<C> Index<Entity> for ComponentData<C>
Source§impl<C> IndexMut<Entity> for ComponentData<C>
impl<C> IndexMut<Entity> for ComponentData<C>
Auto Trait Implementations§
impl<C> Freeze for ComponentData<C>
impl<C> RefUnwindSafe for ComponentData<C>where
C: RefUnwindSafe,
impl<C> Send for ComponentData<C>where
C: Send,
impl<C> Sync for ComponentData<C>where
C: Sync,
impl<C> Unpin for ComponentData<C>where
C: Unpin,
impl<C> UnwindSafe for ComponentData<C>where
C: 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