Skip to main content

ContainsEntity

Trait ContainsEntity 

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§

fn entity(&self) -> Entity

Returns the contained entity.

Implementations on Foreign Types§

§

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

§

fn entity(&self) -> Entity

§

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

§

fn entity(&self) -> Entity

§

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

§

fn entity(&self) -> Entity

§

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

§

fn entity(&self) -> Entity

§

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

§

fn entity(&self) -> Entity

Implementors§

§

impl ContainsEntity for Entity

§

impl ContainsEntity for EntityMut<'_>

§

impl ContainsEntity for EntityRef<'_>

§

impl ContainsEntity for FilteredEntityMut<'_, '_>

§

impl ContainsEntity for FilteredEntityRef<'_, '_>

§

impl ContainsEntity for UnsafeEntityCell<'_>

§

impl<B> ContainsEntity for EntityMutExcept<'_, '_, B>
where B: Bundle,

§

impl<B> ContainsEntity for EntityRefExcept<'_, '_, B>
where B: Bundle,