GetObject

Trait GetObject 

Source
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§

Source

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.

Source

fn get_object( &self, entity: Entity, ) -> Result<ObjectWorldRef<'_>, EntityNotSpawnedError>

Returns an ObjectWorldRef bounds to the given Entity, if it exists.

Implementations on Foreign Types§

Source§

impl GetObject for World

Implementors§