[]Struct lumol::ParticleVec

pub struct ParticleVec {
    pub name: Vec<String>,
    pub kind: Vec<ParticleKind>,
    pub charge: Vec<f64>,
    pub mass: Vec<f64>,
    pub position: Vec<Vector3D>,
    pub velocity: Vec<Vector3D>,
}

An analog to Vec<Particle> with Struct of Array (SoA) layout

Fields

name: Vec<String>

A vector of name from a Particle

kind: Vec<ParticleKind>

A vector of kind from a Particle

charge: Vec<f64>

A vector of charge from a Particle

mass: Vec<f64>

A vector of mass from a Particle

position: Vec<Vector3D>

A vector of position from a Particle

velocity: Vec<Vector3D>

A vector of velocity from a Particle

Implementations

impl ParticleVec

pub fn new() -> ParticleVec

pub fn with_capacity(capacity: usize) -> ParticleVec

Similar to Vec<Particle> ::with_capacity(), initializing all fields with the given capacity.

pub fn capacity(&self) -> usize

Similar to Vec<Particle> ::capacity(), the capacity of all fields should be the same.

pub fn reserve(&mut self, additional: usize)

Similar to Vec<Particle> ::reserve(), reserving the same additional space for all fields.

pub fn reserve_exact(&mut self, additional: usize)

Similar to Vec<Particle> ::reserve_exact() reserving the same additional space for all fields.

pub fn shrink_to_fit(&mut self)

Similar to Vec<Particle> ::shrink_to_fit() shrinking all fields.

pub fn truncate(&mut self, len: usize)

Similar to Vec<Particle> ::truncate() truncating all fields.

pub fn push(&mut self, value: Particle)

pub fn len(&self) -> usize

Similar to Vec<Particle> ::len(), all the fields should have the same length.

pub fn is_empty(&self) -> bool

Similar to Vec<Particle> ::is_empty(), all the fields should have the same length.

pub fn swap_remove(&mut self, index: usize) -> Particle

pub fn insert(&mut self, index: usize, element: Particle)

pub fn remove(&mut self, index: usize) -> Particle

pub fn pop(&mut self) -> Option<Particle>

pub fn append(&mut self, other: &mut ParticleVec)

pub fn clear(&mut self)

pub fn split_off(&mut self, at: usize) -> ParticleVec

pub fn as_slice(&self) -> ParticleSlice<'_>

pub fn as_mut_slice(&mut self) -> ParticleSliceMut<'_>

pub fn slice(&self, range: Range<usize>) -> ParticleSlice<'_>

Create a slice of this vector matching the given range. This is analogous to Index<Range<usize>>.

pub fn slice_mut(&mut self, range: Range<usize>) -> ParticleSliceMut<'_>

Create a mutable slice of this vector matching the given range. This is analogous to IndexMut<Range<usize>>.

pub fn retain<F>(&mut self, f: F) where
    F: FnMut(ParticleRef<'_>) -> bool

pub fn as_ptr(&self) -> ParticlePtr

pub fn as_mut_ptr(&mut self) -> ParticlePtrMut

pub unsafe fn from_raw_parts(
    data: ParticlePtrMut,
    len: usize,
    capacity: usize
) -> ParticleVec

impl ParticleVec

pub fn resize<T>(&mut self, new_len: usize, value: Particle)

impl ParticleVec

pub fn iter(&self) -> Iter<'_>

Get an iterator over the ParticleRef in this vector

impl ParticleVec

pub fn iter_mut(&mut self) -> IterMut<'_>

Get a mutable iterator over the ParticleRefMut in this vector

Trait Implementations

impl Clone for ParticleVec

impl Debug for ParticleVec

impl FromIterator<Particle> for ParticleVec

impl<'a> IntoIterator for &'a ParticleVec

type Item = ParticleRef<'a>

The type of the elements being iterated over.

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?

impl<'a> IntoIterator for &'a mut ParticleVec

type Item = ParticleRefMut<'a>

The type of the elements being iterated over.

type IntoIter = IterMut<'a>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl RefUnwindSafe for ParticleVec

impl Send for ParticleVec

impl Sync for ParticleVec

impl Unpin for ParticleVec

impl UnwindSafe for ParticleVec

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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,