Skip to main content

StoreField

Trait StoreField 

Source
pub trait StoreField: Send + 'static {
    type Snapshot: Send + 'static;

    // Required methods
    fn bind(&mut self, scene: SceneId, owner: Owner);
    fn snapshot(&self) -> Self::Snapshot;
    fn restore(&mut self, from: &Self::Snapshot, scene: SceneId, owner: Owner);

    // Provided methods
    fn boundary(&mut self, _owner: Owner) { ... }
    fn release(&mut self, _entity: Entity, _owner: Owner) { ... }
}
Expand description

A storage-field contract; only Stores implementations call its lifetime hooks.

Required Associated Types§

Source

type Snapshot: Send + 'static

Required Methods§

Source

fn bind(&mut self, scene: SceneId, owner: Owner)

Source

fn snapshot(&self) -> Self::Snapshot

Source

fn restore(&mut self, from: &Self::Snapshot, scene: SceneId, owner: Owner)

Provided Methods§

Source

fn boundary(&mut self, _owner: Owner)

Source

fn release(&mut self, _entity: Entity, _owner: Owner)

Implementors§

Source§

impl<T: Clone + Send + 'static> StoreField for Relation<T>

Source§

impl<T: Clone + Send + 'static> StoreField for Value<T>

Source§

impl<T: Clone + Send + 'static> StoreField for Store<T>