[−][src]Struct quill_prototype::EntityRef
A handle to an entity. Provides access to components.
This handle cannot be sent to another thread, as it requires
access to the main server state. To persist entity handles across
thread boundaries, you may use EntityId
instead.
Implementations
impl EntityRef
[src]
pub fn get<T: Component>(self) -> Result<ComponentRef<T>, ComponentError>
[src]
Gets a component of this entity.
Returns an error if the entity does not have this component or if the entity no longer exists.
pub fn get_mut<T: Component>(self) -> Result<ComponentRefMut<T>, ComponentError>
[src]
Gets a mutable reference to a component of this entity.
Returns an error if the entity does not have this component or if the entity no longer exists.
pub fn add<T: Component>(self, _component: T) -> Result<(), EntityDead>
[src]
Adds a component to this entity.
If the entity already has a component of type T
,
then the component is overwritten.
pub fn send_message(self, _message: &str) -> Result<(), ComponentError>
[src]
Sends a message to this entity.
Returns an error if this entity cannot receive a message. (Usually, only players and the console are capable of receiving messages.)
pub fn id(self) -> EntityId
[src]
Returns the ID of this entity. This ID can be stored
for later use, usually through State::entity
.
pub fn position(self) -> Result<Position, ComponentError>
[src]
Returns this entity's Position
component.
pub fn name(self) -> Result<Name, ComponentError>
[src]
Returns this entity's Name
component.
pub fn uuid(self) -> Result<Uuid, ComponentError>
[src]
Returns this entity's Uuid
component.
Trait Implementations
impl Clone for EntityRef
[src]
impl Copy for EntityRef
[src]
impl Debug for EntityRef
[src]
impl Eq for EntityRef
[src]
impl Hash for EntityRef
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<EntityRef> for EntityRef
[src]
impl StructuralEq for EntityRef
[src]
impl StructuralPartialEq for EntityRef
[src]
Auto Trait Implementations
impl RefUnwindSafe for EntityRef
impl !Send for EntityRef
impl !Sync for EntityRef
impl Unpin for EntityRef
impl UnwindSafe for EntityRef
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Component for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,