Trait rinecs::component::Component[][src]

pub trait Component: 'static + Sized {
    type Storage;
    type MutStorageCacheGuard: CacheConstructor;
    fn type_name() -> &'static str;
fn is_reference() -> bool; fn id() -> Id { ... }
fn references_other() -> Option<Box<dyn Fn(&Storages, &Entity) -> Entity>> { ... } }

Main Component trait.

Usually implemented using a derive attribute as in:

#[derive(Component, Debug)]
struct Position{}

Allows to add a type as an entity’s component.

Associated Types

type Storage[src]

type MutStorageCacheGuard: CacheConstructor[src]

Loading content...

Required methods

fn type_name() -> &'static str[src]

fn is_reference() -> bool[src]

Loading content...

Provided methods

fn id() -> Id[src]

fn references_other() -> Option<Box<dyn Fn(&Storages, &Entity) -> Entity>>[src]

Loading content...

Implementors

Loading content...