pub trait EntityBehaviourRegistry: Send + Sync {
// Required methods
fn register<'life0, 'async_trait>(
&'life0 self,
entity_behaviour_ty: EntityBehaviourTypeId,
factory: Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unregister<'life0, 'life1, 'async_trait>(
&'life0 self,
entity_behaviour_ty: &'life1 EntityBehaviourTypeId,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn register_all<'life0, 'life1, 'async_trait>(
&'life0 self,
factories: &'life1 BehaviourFactories<Uuid, ReactiveEntity>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn unregister_all<'life0, 'life1, 'async_trait>(
&'life0 self,
tys: &'life1 EntityBehaviourTypeIds,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Required Methods§
Sourcefn register<'life0, 'async_trait>(
&'life0 self,
entity_behaviour_ty: EntityBehaviourTypeId,
factory: Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register<'life0, 'async_trait>(
&'life0 self,
entity_behaviour_ty: EntityBehaviourTypeId,
factory: Arc<dyn BehaviourFactory<Uuid, ReactiveEntity> + Send + Sync>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Registers a factory for creating entity behaviours. If an entity instance is of the entity type then the given behaviour is applied. The behaviour will be created using the given EntityBehaviourCreator.
Provided Methods§
fn register_all<'life0, 'life1, 'async_trait>(
&'life0 self,
factories: &'life1 BehaviourFactories<Uuid, ReactiveEntity>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn unregister_all<'life0, 'life1, 'async_trait>(
&'life0 self,
tys: &'life1 EntityBehaviourTypeIds,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unregister_all<'life0, 'life1, 'async_trait>(
&'life0 self,
tys: &'life1 EntityBehaviourTypeIds,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unregisters the behaviour factories for the given entity behaviour types.