Struct bevy::ecs::event::EventParIter
source · pub struct EventParIter<'a, E>where
E: Event,{ /* private fields */ }
Expand description
A parallel iterator over Event
s.
Implementations§
source§impl<'a, E> EventParIter<'a, E>where
E: Event,
impl<'a, E> EventParIter<'a, E>where
E: Event,
sourcepub fn new(
reader: &'a mut ManualEventReader<E>,
events: &'a Events<E>
) -> EventParIter<'a, E>
pub fn new( reader: &'a mut ManualEventReader<E>, events: &'a Events<E> ) -> EventParIter<'a, E>
Creates a new parallel iterator over events
that have not yet been seen by reader
.
sourcepub fn batching_strategy(
self,
strategy: BatchingStrategy
) -> EventParIter<'a, E>
pub fn batching_strategy( self, strategy: BatchingStrategy ) -> EventParIter<'a, E>
Changes the batching strategy used when iterating.
For more information on how this affects the resultant iteration, see
BatchingStrategy
.
sourcepub fn for_each<FN>(self, func: FN)
pub fn for_each<FN>(self, func: FN)
Runs the provided closure for each unread event in parallel.
Unlike normal iteration, the event order is not guaranteed in any form.
§Panics
If the ComputeTaskPool
is not initialized. If using this from an event reader that is being
initialized and run from the ECS scheduler, this should never panic.
sourcepub fn for_each_with_id<FN>(self, func: FN)
pub fn for_each_with_id<FN>(self, func: FN)
Runs the provided closure for each unread event in parallel, like for_each
,
but additionally provides the EventId
to the closure.
Note that the order of iteration is not guaranteed, but EventId
s are ordered by send order.
§Panics
If the ComputeTaskPool
is not initialized. If using this from an event reader that is being
initialized and run from the ECS scheduler, this should never panic.
Trait Implementations§
source§impl<'a, E> Debug for EventParIter<'a, E>
impl<'a, E> Debug for EventParIter<'a, E>
source§impl<'a, E> IntoIterator for EventParIter<'a, E>where
E: Event,
impl<'a, E> IntoIterator for EventParIter<'a, E>where
E: Event,
§type IntoIter = EventIteratorWithId<'a, E>
type IntoIter = EventIteratorWithId<'a, E>
§type Item = <<EventParIter<'a, E> as IntoIterator>::IntoIter as Iterator>::Item
type Item = <<EventParIter<'a, E> as IntoIterator>::IntoIter as Iterator>::Item
source§fn into_iter(self) -> <EventParIter<'a, E> as IntoIterator>::IntoIter
fn into_iter(self) -> <EventParIter<'a, E> as IntoIterator>::IntoIter
Auto Trait Implementations§
impl<'a, E> Freeze for EventParIter<'a, E>
impl<'a, E> RefUnwindSafe for EventParIter<'a, E>where
E: RefUnwindSafe,
impl<'a, E> Send for EventParIter<'a, E>
impl<'a, E> Sync for EventParIter<'a, E>
impl<'a, E> Unpin for EventParIter<'a, E>
impl<'a, E> !UnwindSafe for EventParIter<'a, E>
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.