Struct legion::storage::EntityLayout[][src]

pub struct EntityLayout { /* fields omitted */ }

Describes the component types which are attached to an entity.

Implementations

impl EntityLayout[src]

pub fn new() -> Self[src]

Constructs a new entity layout.

pub fn register_component<T: Component>(&mut self)[src]

Adds a new component to the layout.

pub unsafe fn register_component_raw(
    &mut self,
    type_id: ComponentTypeId,
    f: fn() -> Box<dyn UnknownComponentStorage>
)
[src]

Adds a new component to the layout.

Safety

The storage returned from the storage constructor function must be capable of storing the component type identified by type_id.

pub fn component_types(&self) -> &[ComponentTypeId]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

Returns a slice of component type IDs for the components inside the layout.

pub fn has_component<T: Component>(&self) -> bool[src]

Returns true if the layout contains the given component type.

pub fn has_component_by_id(&self, type_id: ComponentTypeId) -> bool[src]

Returns true if the layout contains the given component type.

Trait Implementations

impl Clone for EntityLayout[src]

impl Debug for EntityLayout[src]

impl Default for EntityLayout[src]

impl LayoutFilter for EntityLayout[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.