Trait shipyard::iter::IntoIter [−][src]
Trait used to create iterators.
Yields Mut
for mutable components.
std::iter::IntoIterator
can’t be used directly because of conflicting implementation.
This trait serves as substitute.
Associated Types
type IntoIter: Iterator
[src]
type IntoParIter
[src]
Required methods
fn iter(self) -> Self::IntoIter
[src]
Returns an iterator over SparseSet
.
Yields Mut
for mutable components.
It deref
s to the component and will flag mutation.
fast_iter
can be used if you want an iterator yielding &mut T
, it has limitations however.
Example
use shipyard::{EntitiesViewMut, IntoIter, ViewMut, World}; let world = World::new(); let (mut entities, mut usizes, mut u32s) = world.borrow::<(EntitiesViewMut, ViewMut<usize>, ViewMut<u32>)>().unwrap(); entities.add_entity((&mut usizes, &mut u32s), (0usize, 1u32)); entities.add_entity((&mut usizes, &mut u32s), (2usize, 3u32)); (&mut usizes, &u32s).iter().for_each(|(mut x, &y)| { *x += y as usize; });
fn iter_by<D: 'static>(self) -> Self::IntoIter
[src]
Returns an iterator over SparseSet
, its order is based on D
.
Returns Mut
when yielding mutable components.
It deref
s to the component and will flag mutation.
fast_iter_by
can be used if you want an iterator yielding &mut T
, it has limitations however.
fn par_iter(self) -> Self::IntoParIter
[src]
parallel
only.Returns a parallel iterator over SparseSet
.
Yields Mut
for mutable components.
It deref
s to the component and will flag mutation.
fast_par_iter
can be used if you want an iterator yielding &mut T
, it has limitations however.
Example
use rayon::prelude::ParallelIterator; use shipyard::{EntitiesViewMut, IntoIter, ViewMut, World}; let world = World::new(); let (mut entities, mut usizes, mut u32s) = world.borrow::<(EntitiesViewMut, ViewMut<usize>, ViewMut<u32>)>().unwrap(); entities.add_entity((&mut usizes, &mut u32s), (0usize, 1u32)); entities.add_entity((&mut usizes, &mut u32s), (2usize, 3u32)); (&mut usizes, &u32s).par_iter().for_each(|(mut x, &y)| { *x += y as usize; });
Implementations on Foreign Types
impl<T: IntoAbstract> IntoIter for (T,) where
<T::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<T::AbsView as AbstractMut>::Index: From<usize> + Clone,
type IntoIter = Iter<(T::AbsView,)>
type IntoParIter = ParIter<(T::AbsView,)>
fn iter(self) -> Self::IntoIter
[src]
fn iter_by<D: 'static>(self) -> Self::IntoIter
[src]
fn par_iter(self) -> Self::IntoParIter
[src]
impl<A: IntoAbstract, B: IntoAbstract> IntoIter for (A, B) where
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
type IntoIter = Iter<(A::AbsView, B::AbsView)>
type IntoParIter = ParIter<(A::AbsView, B::AbsView)>
fn iter(self) -> Self::IntoIter
[src]
fn iter_by<Driver: 'static>(self) -> Self::IntoIter
[src]
fn par_iter(self) -> Self::IntoParIter
[src]
impl<A: IntoAbstract, B: IntoAbstract, C: IntoAbstract> IntoIter for (A, B, C) where
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
type IntoIter = Iter<(A::AbsView, B::AbsView, C::AbsView)>
type IntoParIter = ParIter<(A::AbsView, B::AbsView, C::AbsView)>
fn iter(self) -> Self::IntoIter
[src]
fn iter_by<Driver: 'static>(self) -> Self::IntoIter
[src]
fn par_iter(self) -> Self::IntoParIter
[src]
impl<A: IntoAbstract, B: IntoAbstract, C: IntoAbstract, D: IntoAbstract> IntoIter for (A, B, C, D) where
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
type IntoIter = Iter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView)>
type IntoParIter = ParIter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView)>
fn iter(self) -> Self::IntoIter
[src]
fn iter_by<Driver: 'static>(self) -> Self::IntoIter
[src]
fn par_iter(self) -> Self::IntoParIter
[src]
impl<A: IntoAbstract, B: IntoAbstract, C: IntoAbstract, D: IntoAbstract, E: IntoAbstract> IntoIter for (A, B, C, D, E) where
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
type IntoIter = Iter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView)>
type IntoParIter = ParIter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView)>
fn iter(self) -> Self::IntoIter
[src]
fn iter_by<Driver: 'static>(self) -> Self::IntoIter
[src]
fn par_iter(self) -> Self::IntoParIter
[src]
impl<A: IntoAbstract, B: IntoAbstract, C: IntoAbstract, D: IntoAbstract, E: IntoAbstract, F: IntoAbstract> IntoIter for (A, B, C, D, E, F) where
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
type IntoIter = Iter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView, F::AbsView)>
type IntoParIter = ParIter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView, F::AbsView)>
fn iter(self) -> Self::IntoIter
[src]
fn iter_by<Driver: 'static>(self) -> Self::IntoIter
[src]
fn par_iter(self) -> Self::IntoParIter
[src]
impl<A: IntoAbstract, B: IntoAbstract, C: IntoAbstract, D: IntoAbstract, E: IntoAbstract, F: IntoAbstract, G: IntoAbstract> IntoIter for (A, B, C, D, E, F, G) where
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
<G::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
<G::AbsView as AbstractMut>::Index: From<usize> + Clone,
type IntoIter = Iter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView, F::AbsView, G::AbsView)>
type IntoParIter = ParIter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView, F::AbsView, G::AbsView)>
fn iter(self) -> Self::IntoIter
[src]
fn iter_by<Driver: 'static>(self) -> Self::IntoIter
[src]
fn par_iter(self) -> Self::IntoParIter
[src]
impl<A: IntoAbstract, B: IntoAbstract, C: IntoAbstract, D: IntoAbstract, E: IntoAbstract, F: IntoAbstract, G: IntoAbstract, H: IntoAbstract> IntoIter for (A, B, C, D, E, F, G, H) where
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
<G::AbsView as AbstractMut>::Index: From<usize> + Clone,
<H::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
<G::AbsView as AbstractMut>::Index: From<usize> + Clone,
<H::AbsView as AbstractMut>::Index: From<usize> + Clone,
type IntoIter = Iter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView, F::AbsView, G::AbsView, H::AbsView)>
type IntoParIter = ParIter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView, F::AbsView, G::AbsView, H::AbsView)>
fn iter(self) -> Self::IntoIter
[src]
fn iter_by<Driver: 'static>(self) -> Self::IntoIter
[src]
fn par_iter(self) -> Self::IntoParIter
[src]
impl<A: IntoAbstract, B: IntoAbstract, C: IntoAbstract, D: IntoAbstract, E: IntoAbstract, F: IntoAbstract, G: IntoAbstract, H: IntoAbstract, I: IntoAbstract> IntoIter for (A, B, C, D, E, F, G, H, I) where
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
<G::AbsView as AbstractMut>::Index: From<usize> + Clone,
<H::AbsView as AbstractMut>::Index: From<usize> + Clone,
<I::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
<G::AbsView as AbstractMut>::Index: From<usize> + Clone,
<H::AbsView as AbstractMut>::Index: From<usize> + Clone,
<I::AbsView as AbstractMut>::Index: From<usize> + Clone,
type IntoIter = Iter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView, F::AbsView, G::AbsView, H::AbsView, I::AbsView)>
type IntoParIter = ParIter<(A::AbsView, B::AbsView, C::AbsView, D::AbsView, E::AbsView, F::AbsView, G::AbsView, H::AbsView, I::AbsView)>
fn iter(self) -> Self::IntoIter
[src]
fn iter_by<Driver: 'static>(self) -> Self::IntoIter
[src]
fn par_iter(self) -> Self::IntoParIter
[src]
impl<A: IntoAbstract, B: IntoAbstract, C: IntoAbstract, D: IntoAbstract, E: IntoAbstract, F: IntoAbstract, G: IntoAbstract, H: IntoAbstract, I: IntoAbstract, J: IntoAbstract> IntoIter for (A, B, C, D, E, F, G, H, I, J) where
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
<G::AbsView as AbstractMut>::Index: From<usize> + Clone,
<H::AbsView as AbstractMut>::Index: From<usize> + Clone,
<I::AbsView as AbstractMut>::Index: From<usize> + Clone,
<J::AbsView as AbstractMut>::Index: From<usize> + Clone,
[src]
<A::AbsView as AbstractMut>::Index: From<usize> + Clone,
<B::AbsView as AbstractMut>::Index: From<usize> + Clone,
<C::AbsView as AbstractMut>::Index: From<usize> + Clone,
<D::AbsView as AbstractMut>::Index: From<usize> + Clone,
<E::AbsView as AbstractMut>::Index: From<usize> + Clone,
<F::AbsView as AbstractMut>::Index: From<usize> + Clone,
<G::AbsView as AbstractMut>::Index: From<usize> + Clone,
<H::AbsView as AbstractMut>::Index: From<usize> + Clone,
<I::AbsView as AbstractMut>::Index: From<usize> + Clone,
<J::AbsView as AbstractMut>::Index: From<usize> + Clone,