[][src]Struct bevy_ecs::QueryBorrowChecked

pub struct QueryBorrowChecked<'w, Q: HecsQuery> { /* fields omitted */ }

A borrow of a World sufficient to execute the query Q

Note that borrows are not released until this object is dropped.

Implementations

impl<'w, Q: HecsQuery> QueryBorrowChecked<'w, Q>[src]

pub fn iter<'q>(&'q mut self) -> QueryIter<'q, 'w, Q>[src]

Execute the query

Must be called only once per query.

pub fn par_iter<'q>(&'q mut self, batch_size: usize) -> ParIter<'q, 'w, Q>[src]

Like iter, but returns child iterators of at most batch_size elements

Useful for distributing work over a threadpool using the ParallelIterator interface.

Batch size needs to be chosen based on the task being done in parallel. The elements in each batch are computed serially, while the batches themselves are computed in parallel.

A too small batch size can cause too much overhead, since scheduling each batch could take longer than running the batch. On the other hand, a too large batch size risks that one batch is still running long after the rest have finished.

Trait Implementations

impl<'w, Q: HecsQuery> Drop for QueryBorrowChecked<'w, Q>[src]

impl<'q, 'w, Q: HecsQuery> IntoIterator for &'q mut QueryBorrowChecked<'w, Q>[src]

type IntoIter = QueryIter<'q, 'w, Q>

Which kind of iterator are we turning this into?

type Item = <Q::Fetch as Fetch<'q>>::Item

The type of the elements being iterated over.

impl<'w, Q: HecsQuery> Send for QueryBorrowChecked<'w, Q>[src]

impl<'w, Q: HecsQuery> Sync for QueryBorrowChecked<'w, Q>[src]

Auto Trait Implementations

impl<'w, Q> !RefUnwindSafe for QueryBorrowChecked<'w, Q>

impl<'w, Q> Unpin for QueryBorrowChecked<'w, Q> where
    Q: Unpin

impl<'w, Q> !UnwindSafe for QueryBorrowChecked<'w, Q>

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> Component for T where
    T: 'static + Send + Sync
[src]

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

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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>,