pub trait GetObject {
// Required methods
fn object(&self, entity: Entity) -> ObjectWorldRef<'_>;
fn get_object(
&self,
entity: Entity,
) -> Result<ObjectWorldRef<'_>, EntityNotSpawnedError>;
}Expand description
Trait used to access an ObjectWorldRef from World.
Required Methods§
Sourcefn object(&self, entity: Entity) -> ObjectWorldRef<'_>
fn object(&self, entity: Entity) -> ObjectWorldRef<'_>
Returns an ObjectWorldRef bounds to the given Entity.
§Safety
This method will panic! if given entity is invalid.
See get_object for a safer alternative.
Sourcefn get_object(
&self,
entity: Entity,
) -> Result<ObjectWorldRef<'_>, EntityNotSpawnedError>
fn get_object( &self, entity: Entity, ) -> Result<ObjectWorldRef<'_>, EntityNotSpawnedError>
Returns an ObjectWorldRef bounds to the given Entity, if it exists.