pub struct ComponentStorage<'a, C, D> { /* private fields */ }

Implementations§

source§

impl<'a, C: Component, D: Borrow<UnsafeVec>> ComponentStorage<'a, C, D>

source

pub fn contains(&self, entity_id: ArchEntityId) -> bool

Checks whether self container specific entity.

source

pub unsafe fn get_unchecked(&self, entity_id: ArchEntityId) -> &'a C

Returns a reference to the component C of the specified entity. Safety: entity must exist.

source

pub fn get(&self, entity_id: ArchEntityId) -> Option<&'a C>

Returns a reference to component C of the specified entity.

source§

impl<'a, C: Component> ComponentStorage<'a, C, &'a UnsafeVec>

source

pub fn iter(self) -> Iter<'a, C, Self>

Returns an iterator over all components.

source§

impl<'a, C: Component> ComponentStorage<'a, C, &'a mut UnsafeVec>

source

pub unsafe fn get_unchecked_mut(&mut self, entity_id: ArchEntityId) -> &'a mut C

Returns a mutable reference to the component C of the specified entity id. Safety: component at entity_id must exist.

source

pub fn get_mut(&mut self, entity_id: ArchEntityId) -> Option<&'a mut C>

Returns a mutable reference to the component C of the specified entity id.

source

pub fn iter_mut(&'a mut self) -> IterMut<'a, C, &mut Self>

Returns an iterator over all components.

Trait Implementations§

source§

impl<'a, C, D: Borrow<UnsafeVec> + Copy> Clone for ComponentStorage<'a, C, D>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, C, D: Borrow<UnsafeVec> + Copy> Copy for ComponentStorage<'a, C, D>

Auto Trait Implementations§

§

impl<'a, C, D> RefUnwindSafe for ComponentStorage<'a, C, D>where C: RefUnwindSafe, D: RefUnwindSafe,

§

impl<'a, C, D> Send for ComponentStorage<'a, C, D>where C: Send, D: Send,

§

impl<'a, C, D> Sync for ComponentStorage<'a, C, D>where C: Sync, D: Sync,

§

impl<'a, C, D> Unpin for ComponentStorage<'a, C, D>where C: Unpin, D: Unpin,

§

impl<'a, C, D> UnwindSafe for ComponentStorage<'a, C, D>where C: UnwindSafe, D: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Component for Twhere T: Send + Sync + 'static,