pub trait ParView<'a>: ParViewSeal<'a> + Send { }Available on crate feature
rayon only.Expand description
A parallel view over a single aspect of an entity.
The main difference between this trait and the standard View trait is that this view can be
shared between threads, allowing it to be used within parallel iteration in either a
ParSystem or a par_query.
All types that implement View also implement ParView, so long as any Component C they
view is Send when viewed mutably or Sync when viewed immutably.
§Example
// Define a component.
struct Foo(usize);
// Define a view over that component.
type FooView<'a> = &'a Foo;Because the Component viewed in the above example implements Sync, the view created above
implements ParView.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".