Trait ContainsEntity

Source
pub trait ContainsEntity {
    // Required method
    fn entity(&self) -> Entity;
}
Expand description

A trait for types that contain an Entity.

This trait behaves similarly to Borrow<Entity>, but yielding Entity directly.

It should only be implemented when:

  • Retrieving the Entity is a simple operation.
  • The Entity contained by the type is unambiguous.

Required Methods§

Source

fn entity(&self) -> Entity

Returns the contained entity.

Implementations on Foreign Types§

Source§

impl<T> ContainsEntity for &T
where T: ContainsEntity,

Source§

fn entity(&self) -> Entity

Source§

impl<T> ContainsEntity for &mut T
where T: ContainsEntity,

Source§

fn entity(&self) -> Entity

Source§

impl<T> ContainsEntity for Rc<T>
where T: ContainsEntity,

Source§

fn entity(&self) -> Entity

Implementors§