[]Struct lumol::sys::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

Methods

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<'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?

impl Clone for ParticleVec

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for ParticleVec

Auto Trait Implementations

impl Send for ParticleVec

impl Sync for ParticleVec

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]