Struct particular::ParticleSet
source · [−]Implementations
sourceimpl<P: Particle + Sync> ParticleSet<P>
impl<P: Particle + Sync> ParticleSet<P>
sourcepub fn iter(&self) -> impl Iterator<Item = &P>
pub fn iter(&self) -> impl Iterator<Item = &P>
Iterates over the massive particles, then the massless ones.
sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut P>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut P>
Mutably iterates over the massive particles, then the massless ones.
sourcepub fn result(&mut self) -> Vec<(&mut P, Vec3)>
pub fn result(&mut self) -> Vec<(&mut P, Vec3)>
Returns a vector holding tuples of a mutable reference to a Particle-like object and its computed gravitational acceleration.
for (particle, acceleration) in particle_set.result() {
// Here you can modify your type implementing `Particle` according to its computed acceleration.
}Trait Implementations
sourceimpl<P: Default + Particle + Sync> Default for ParticleSet<P>
impl<P: Default + Particle + Sync> Default for ParticleSet<P>
sourcefn default() -> ParticleSet<P>
fn default() -> ParticleSet<P>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<P> RefUnwindSafe for ParticleSet<P> where
P: RefUnwindSafe,
impl<P> Send for ParticleSet<P> where
P: Send,
impl<P> Sync for ParticleSet<P>
impl<P> Unpin for ParticleSet<P> where
P: Unpin,
impl<P> UnwindSafe for ParticleSet<P> where
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more