Struct legion::storage::Components[][src]

pub struct Components { /* fields omitted */ }

Contains the storages for all component types in a world.

Implementations

impl Components[src]

pub fn get_or_insert_with<F>(
    &mut self,
    type_id: ComponentTypeId,
    create: F
) -> &mut dyn UnknownComponentStorage where
    F: FnMut() -> Box<dyn UnknownComponentStorage>, 
[src]

Gets or inserts the storage for the given component type.

pub fn get(
    &self,
    type_id: ComponentTypeId
) -> Option<&dyn UnknownComponentStorage>
[src]

Returns the storage for the given component type.

pub fn get_downcast<T: Component>(&self) -> Option<&T::Storage>[src]

Returns the storage for the given component type.

pub fn get_mut(
    &mut self,
    type_id: ComponentTypeId
) -> Option<&mut dyn UnknownComponentStorage>
[src]

Returns the storage for the given component type.

pub fn get_downcast_mut<T: Component>(&mut self) -> Option<&mut T::Storage>[src]

Returns the storage for the given component type.

pub fn get_multi_mut(&mut self) -> MultiMut<'_>[src]

Returns a writer for writing to multiple component storages.

pub fn pack(&mut self, options: &PackOptions)[src]

Repacks all component storages.

Trait Implementations

impl Debug for Components[src]

impl Default for Components[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.