[−][src]Trait akashi::ComponentBackend
This trait is used to mark backing storage objects for Components
.
Structs that implement this trait can be passed to
ComponentManager::register_component
to allow Entities to load and store Component data.
Required methods
fn load(&self, entity: &T) -> Result<Option<U>, Error>
Loads an instance of a Component
from storage.
fn store(&self, entity: &T, component: U) -> Result<(), Error>
Saves an instance of a Component
to storage.
fn exists(&self, entity: &T) -> Result<bool, Error>
Check to see if there is any stored Component
data associated
with an Entity
.
fn delete(&self, entity: &T) -> Result<(), Error>
Delete the stored Component
data associated with the given
Entity
, if any.
Implementors
impl<E, F, T, W> ComponentBackend<E, T> for ComponentAdapter<E, F, T, W> where
E: Entity + 'static,
F: Into<T> + Component<E> + 'static,
T: Into<F> + Component<E> + 'static,
W: ComponentBackend<E, F> + Sync + Send,
[src]
E: Entity + 'static,
F: Into<T> + Component<E> + 'static,
T: Into<F> + Component<E> + 'static,
W: ComponentBackend<E, F> + Sync + Send,
fn load(&self, entity: &E) -> Result<Option<T>, Error>
[src]
fn store(&self, entity: &E, component: T) -> Result<(), Error>
[src]
fn exists(&self, entity: &E) -> Result<bool, Error>
[src]
fn delete(&self, entity: &E) -> Result<(), Error>
[src]
impl<T, U> ComponentBackend<T, U> for LocalComponentStorage<T, U> where
T: Entity + 'static,
U: Component<T> + Clone + 'static,
[src]
T: Entity + 'static,
U: Component<T> + Clone + 'static,