pub(crate) struct DamageHistoryBinding {
state: SyncMutex<BindingState>,
}Expand description
Serializes history writes with removal and gameplay ownership changes.
Fields§
§state: SyncMutex<BindingState>Implementations§
Source§impl DamageHistoryBinding
impl DamageHistoryBinding
Sourcepub(crate) fn retain_owner(&self) -> Arc<()> ⓘ
pub(crate) fn retain_owner(&self) -> Arc<()> ⓘ
The marker must live in a gameplay owner, never in the entity itself.
pub(super) fn record( &self, history: &Arc<DamageHistory>, generation: EntityGeneration, source: &DamageSource, clock: &Arc<GameTime>, )
Sourcepub(crate) fn release_on_removal(
&self,
) -> Option<(Arc<DamageHistory>, Option<DamageSource>)>
pub(crate) fn release_on_removal( &self, ) -> Option<(Arc<DamageHistory>, Option<DamageSource>)>
Both the source and the upgraded history can own entities. Drop them outside the entity lifecycle lock, including when this is the last history handle.
pub(crate) fn clear_removed(&self)
pub(crate) fn last_damage_source(&self) -> Option<RecentDamageSource>
fn bound_history(&self) -> Option<(Arc<DamageHistory>, EntityGeneration)>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DamageHistoryBinding
impl !RefUnwindSafe for DamageHistoryBinding
impl !UnwindSafe for DamageHistoryBinding
impl Send for DamageHistoryBinding
impl Sync for DamageHistoryBinding
impl Unpin for DamageHistoryBinding
impl UnsafeUnpin for DamageHistoryBinding
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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 moreWraps this value in an
Arc<SyncMutex<>>