pub struct EntityBehaviourStorage(/* private fields */);
Implementations§
Source§impl EntityBehaviourStorage
impl EntityBehaviourStorage
pub fn new() -> Self
pub fn insert( &self, key: Uuid, ty: BehaviourTypeId, behaviour: Arc<dyn BehaviourFsm<Uuid, ReactiveEntity> + Send + Sync>, ) -> Option<Arc<dyn BehaviourFsm<Uuid, ReactiveEntity> + Send + Sync>>
pub fn remove( &self, key: &Uuid, ty: &BehaviourTypeId, ) -> Option<(BehaviourTypeId, Arc<dyn BehaviourFsm<Uuid, ReactiveEntity> + Send + Sync>)>
Sourcepub fn remove_by_behaviour(&self, ty: &BehaviourTypeId)
pub fn remove_by_behaviour(&self, ty: &BehaviourTypeId)
Removes all behaviours of the given behaviour type.
pub fn remove_all(&self, key: &Uuid)
pub fn has(&self, key: &Uuid, ty: &BehaviourTypeId) -> bool
pub fn get( &self, key: &Uuid, ty: &BehaviourTypeId, ) -> Option<Arc<dyn BehaviourFsm<Uuid, ReactiveEntity> + Send + Sync>>
pub fn get_by_behaviour( &self, ty: &BehaviourTypeId, ) -> Vec<Arc<dyn BehaviourFsm<Uuid, ReactiveEntity> + Send + Sync>>
pub fn get_behaviours_by_instance(&self, key: &Uuid) -> Vec<BehaviourTypeId>
pub fn get_instances_by_behaviour( &self, ty: &BehaviourTypeId, ) -> Vec<ReactiveEntity>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EntityBehaviourStorage
impl !RefUnwindSafe for EntityBehaviourStorage
impl Send for EntityBehaviourStorage
impl Sync for EntityBehaviourStorage
impl Unpin for EntityBehaviourStorage
impl !UnwindSafe for EntityBehaviourStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more