Struct naia_server::EntityRef
source · [−]pub struct EntityRef<'s, P: ProtocolType, E: Copy + Eq + Hash, W: WorldRefType<P, E>> { /* private fields */ }Expand description
A reference to an Entity being tracked by the Server
Implementations
sourceimpl<'s, P: ProtocolType, E: Copy + Eq + Hash, W: WorldRefType<P, E>> EntityRef<'s, P, E, W>
impl<'s, P: ProtocolType, E: Copy + Eq + Hash, W: WorldRefType<P, E>> EntityRef<'s, P, E, W>
sourcepub fn has_component<R: ReplicateSafe<P>>(&self) -> bool
pub fn has_component<R: ReplicateSafe<P>>(&self) -> bool
Returns whether or not the Entity has an associated Component
sourcepub fn component<R: ReplicateSafe<P>>(
&self
) -> Option<ReplicaRefWrapper<'_, P, R>>
pub fn component<R: ReplicateSafe<P>>(
&self
) -> Option<ReplicaRefWrapper<'_, P, R>>
Gets a Ref to a Component associated with the Entity
Auto Trait Implementations
impl<'s, P, E, W> !RefUnwindSafe for EntityRef<'s, P, E, W>
impl<'s, P, E, W> Send for EntityRef<'s, P, E, W> where
E: Send + Sync,
W: Send,
impl<'s, P, E, W> Sync for EntityRef<'s, P, E, W> where
E: Sync,
W: Sync,
impl<'s, P, E, W> Unpin for EntityRef<'s, P, E, W> where
E: Unpin,
W: Unpin,
impl<'s, P, E, W> !UnwindSafe for EntityRef<'s, P, E, W>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more