[][src]Struct keeshond::scene::Entity

pub struct Entity { /* fields omitted */ }

A handle to a living object in a Scene

Implementations

impl Entity[src]

pub fn new(id: usize, generation: u64) -> Entity[src]

Creates a new Entity with the given ID and generation value. You don't normally need to call this directly. Instead, use Scene::add_entity().

pub fn null() -> Entity[src]

Creates a "null" Entity that refers to no object in particular.

pub fn get_id(&self) -> usize[src]

Returns this Entity's identifier, used for indexing operations. ID values may be reused with other Entities, though only one Entity with a given ID may be alive at a time.

pub fn get_generation(&self) -> u64[src]

Returns this Entity's generation. This is incremented by one every time an Entity is removed and put back into the pool for reuse. When querying based on Entity, both the id and generation must match. This prevents the use of stale Entity handlers.

pub fn is_null(&self) -> bool[src]

Return true if this is a "null" Entity that refers to no object.

Trait Implementations

impl Clone for Entity[src]

impl Debug for Entity[src]

impl Default for Entity[src]

impl Display for Entity[src]

impl Eq for Entity[src]

impl<'_> From<&'_ SpawnArg> for Entity[src]

impl From<Entity> for SpawnArg[src]

impl From<SpawnArg> for Entity[src]

impl Hash for Entity[src]

impl PartialEq<Entity> for Entity[src]

impl StructuralEq for Entity[src]

impl StructuralPartialEq for Entity[src]

Auto Trait Implementations

impl RefUnwindSafe for Entity

impl Send for Entity

impl Sync for Entity

impl Unpin for Entity

impl UnwindSafe for Entity

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.