[][src]Trait mecs::component::Component

pub trait Component<'a, S> where
    S: Storage<'a>, 
{ #[must_use] fn id() -> S::Id;
#[must_use] fn get(storage: &S) -> Option<&Self>;
#[must_use] fn get_mut(storage: &mut S) -> Option<&mut Self>; }

Trait implemented by all types within a storage.

Visitor

This trait uses the visitor pattern to provide getters for the storage.

Required methods

#[must_use] fn id() -> S::Id

Returns this component's id

#[must_use] fn get(storage: &S) -> Option<&Self>

Returns a reference to this component from a storage

#[must_use] fn get_mut(storage: &mut S) -> Option<&mut Self>

Returns a mutable reference to this component from a storage

Loading content...

Implementors

impl<T> Component<'static, DynStorage> for T where
    T: Debug + 'static, 
[src]

Loading content...