pub struct LivingEntityRef<'a> {
entity: &'a SharedEntity,
living: &'a dyn LivingEntity,
}Expand description
A living entity capability tied to the same shared allocation used for attribution.
Fields§
§entity: &'a SharedEntity§living: &'a dyn LivingEntityImplementations§
Source§impl<'a> LivingEntityRef<'a>
impl<'a> LivingEntityRef<'a>
Sourcepub fn new(entity: &'a SharedEntity) -> Option<Self>
pub fn new(entity: &'a SharedEntity) -> Option<Self>
Borrows the living capability, if the entity provides it.
Sourcepub const fn entity(self) -> &'a SharedEntity
pub const fn entity(self) -> &'a SharedEntity
The allocation to retain when constructing a damage source.
Sourcepub const fn living(self) -> &'a dyn LivingEntity
pub const fn living(self) -> &'a dyn LivingEntity
The living capability of this allocation.
Trait Implementations§
Source§impl<'a> Clone for LivingEntityRef<'a>
impl<'a> Clone for LivingEntityRef<'a>
impl<'a> Copy for LivingEntityRef<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LivingEntityRef<'a>
impl<'a> !UnwindSafe for LivingEntityRef<'a>
impl<'a> Freeze for LivingEntityRef<'a>
impl<'a> Send for LivingEntityRef<'a>
impl<'a> Sync for LivingEntityRef<'a>
impl<'a> Unpin for LivingEntityRef<'a>
impl<'a> UnsafeUnpin for LivingEntityRef<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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<>>