[][src]Struct bevy::prelude::Query

pub struct Query<'a, Q> where
    Q: Query, 
{ /* fields omitted */ }

Provides scoped access to a World according to a given [HecsQuery]

Implementations

impl<'a, Q> Query<'a, Q> where
    Q: Query, 
[src]

pub fn new(
    world: &'a World,
    archetype_access: &'a ArchetypeAccess
) -> Query<'a, Q>
[src]

pub fn iter(&mut self) -> QueryBorrowChecked<'_, Q>[src]

pub fn get<T>(&self, entity: Entity) -> Result<Ref<'_, T>, QueryError> where
    T: Component
[src]

Gets a reference to the entity's component of the given type. This will fail if the entity does not have the given component type or if the given component type does not match this query.

pub fn entity(
    &mut self,
    entity: Entity
) -> Result<QueryOneChecked<'_, Q>, QueryError>
[src]

pub fn get_mut<T>(&self, entity: Entity) -> Result<RefMut<'_, T>, QueryError> where
    T: Component
[src]

Gets a mutable reference to the entity's component of the given type. This will fail if the entity does not have the given component type or if the given component type does not match this query.

pub fn removed<C>(&self) -> &[Entity] where
    C: Component
[src]

pub fn set<T>(&mut self, entity: Entity, component: T) -> Result<(), QueryError> where
    T: Component
[src]

Sets the entity's component to the given value. This will fail if the entity does not already have the given component type or if the given component type does not match this query.

Auto Trait Implementations

impl<'a, Q> !RefUnwindSafe for Query<'a, Q>

impl<'a, Q> Send for Query<'a, Q> where
    Q: Send

impl<'a, Q> Sync for Query<'a, Q> where
    Q: Sync

impl<'a, Q> Unpin for Query<'a, Q> where
    Q: Unpin

impl<'a, Q> !UnwindSafe for Query<'a, Q>

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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

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

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

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

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

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

impl<T> Resource for T where
    T: 'static + Send + Sync
[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,