pub struct EntityData<T> { /* private fields */ }Expand description
A value kept on each entity, by uuid, at its key (the mod’s own:
<mod>:<key>); its default where the entity has none yet.
ⓘ
static HITS: EntityData<u32> = EntityData::new("hits");
HITS.with_mut(&damage.uuid, |n| *n += 1);Implementations§
Source§impl<T: Schema + Default> EntityData<T>
impl<T: Schema + Default> EntityData<T>
Sourcepub const fn session(key: &'static str) -> Self
pub const fn session(key: &'static str) -> Self
Kept while the entity is loaded, not saved (a Yog Script member
synced and not saved).
Auto Trait Implementations§
impl<T> Freeze for EntityData<T>
impl<T> RefUnwindSafe for EntityData<T>
impl<T> Send for EntityData<T>
impl<T> Sync for EntityData<T>
impl<T> Unpin for EntityData<T>
impl<T> UnsafeUnpin for EntityData<T>
impl<T> UnwindSafe for EntityData<T>
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