Trait qecs_core::ComponentStore [] [src]

pub trait ComponentStore: StoreBase where Self: for<'a> _ComponentStore<'a, _Component=Self::Component> {
    type Component: Component;
    fn assign<'id, T>(&mut self, id: Valid<'id, Self::Id>, com: T) -> Option<Self::Component> where T: Into<Self::Component>;
    fn release<'id>(&mut self, id: Valid<'id, Self::Id>) -> Option<Self::Component>;
    fn get<'id>(&self, id: Valid<'id, Self::Id>) -> Option<&Self::Component>;
    fn get_mut<'id>(&mut self, id: Valid<'id, Self::Id>) -> Option<&mut Self::Component>;
    fn components<'a>(&'a self) -> Self::Components;
    fn components_mut<'a>(&'a mut self) -> Self::ComponentsMut;
}

Associated Types

Required Methods

fn assign<'id, T>(&mut self, id: Valid<'id, Self::Id>, com: T) -> Option<Self::Component> where T: Into<Self::Component>

fn release<'id>(&mut self, id: Valid<'id, Self::Id>) -> Option<Self::Component>

fn get<'id>(&self, id: Valid<'id, Self::Id>) -> Option<&Self::Component>

Returns None if id is not assigned.

fn get_mut<'id>(&mut self, id: Valid<'id, Self::Id>) -> Option<&mut Self::Component>

Returns None if id is not assigned.

fn components<'a>(&'a self) -> Self::Components

fn components_mut<'a>(&'a mut self) -> Self::ComponentsMut

Implementors