Struct ComponentList

Source
pub struct ComponentList<C: ComponentManager, T: Component>(/* private fields */);

Implementations§

Source§

impl<C: ComponentManager, T: Component> ComponentList<C, T>

Source

pub fn hot() -> ComponentList<C, T>

Source

pub fn cold() -> ComponentList<C, T>

Source

pub fn add(&mut self, entity: &BuildData<'_, C>, component: T) -> Option<T>

Source

pub fn insert(&mut self, entity: &ModifyData<'_, C>, component: T) -> Option<T>

Source

pub fn remove(&mut self, entity: &ModifyData<'_, C>) -> Option<T>

Source

pub fn set<U: EditData<C>>(&mut self, entity: &U, component: T) -> Option<T>

Source

pub fn get<U: EditData<C>>(&self, entity: &U) -> Option<T>
where T: Clone,

Source

pub fn has<U: EditData<C>>(&self, entity: &U) -> bool

Source

pub fn borrow<U: EditData<C>>(&mut self, entity: &U) -> Option<&mut T>

Source

pub fn __clear(&mut self, entity: &IndexedEntity<C>)

Trait Implementations§

Source§

impl<C: ComponentManager, T: Component, U: EditData<C>> Index<U> for ComponentList<C, T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, en: U) -> &T

Performs the indexing (container[index]) operation. Read more
Source§

impl<C: ComponentManager, T: Component, U: EditData<C>> IndexMut<U> for ComponentList<C, T>

Source§

fn index_mut(&mut self, en: U) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<C, T> Freeze for ComponentList<C, T>

§

impl<C, T> RefUnwindSafe for ComponentList<C, T>

§

impl<C, T> Send for ComponentList<C, T>
where C: Send, T: Send,

§

impl<C, T> Sync for ComponentList<C, T>
where C: Sync, T: Sync,

§

impl<C, T> Unpin for ComponentList<C, T>
where C: Unpin, T: Unpin,

§

impl<C, T> UnwindSafe for ComponentList<C, T>
where C: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where T: 'static,