[][src]Struct soa_derive_example::ParticleVec

pub struct ParticleVec {
    pub mass: Vec<f64>,
    pub position: Vec<[f64; 3]>,
    pub kind: Vec<usize>,
    pub name: Vec<String>,
}

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

Fields

mass: Vec<f64>

A vector of mass from a Particle

position: Vec<[f64; 3]>

A vector of position from a Particle

kind: Vec<usize>

A vector of kind from a Particle

name: Vec<String>

A vector of name from a Particle

Implementations

impl ParticleVec[src]

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

Get an iterator over the ParticleRef in this vector

impl ParticleVec[src]

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

Get a mutable iterator over the ParticleRefMut in this vector

impl ParticleVec[src]

pub fn new() -> ParticleVec[src]

pub fn with_capacity(capacity: usize) -> ParticleVec[src]

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

pub fn capacity(&self) -> usize[src]

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

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

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

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

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

pub fn shrink_to_fit(&mut self)[src]

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

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

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

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

pub fn len(&self) -> usize[src]

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

pub fn is_empty(&self) -> bool[src]

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

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

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

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

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

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

pub fn clear(&mut self)[src]

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

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

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

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

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<'_>[src]

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
[src]

pub fn get<'a, I>(&'a self, index: I) -> Option<I::RefOutput> where
    I: SoAIndex<&'a ParticleVec>, 
[src]

pub unsafe fn get_unchecked<'a, I>(&'a self, index: I) -> I::RefOutput where
    I: SoAIndex<&'a ParticleVec>, 
[src]

pub fn index<'a, I>(&'a self, index: I) -> I::RefOutput where
    I: SoAIndex<&'a ParticleVec>, 
[src]

pub fn get_mut<'a, I>(&'a mut self, index: I) -> Option<I::MutOutput> where
    I: SoAIndexMut<&'a mut ParticleVec>, 
[src]

pub unsafe fn get_unchecked_mut<'a, I>(&'a mut self, index: I) -> I::MutOutput where
    I: SoAIndexMut<&'a mut ParticleVec>, 
[src]

pub fn index_mut<'a, I>(&'a mut self, index: I) -> I::MutOutput where
    I: SoAIndexMut<&'a mut ParticleVec>, 
[src]

pub fn as_ptr(&self) -> ParticlePtr[src]

pub fn as_mut_ptr(&mut self) -> ParticlePtrMut[src]

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

Trait Implementations

impl Debug for ParticleVec[src]

impl FromIterator<Particle> for ParticleVec[src]

impl<'a> IntoIterator for &'a ParticleVec[src]

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[src]

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 PartialEq<ParticleVec> for ParticleVec[src]

impl<'a> SoAIndex<&'a ParticleVec> for usize[src]

type RefOutput = ParticleRef<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<&'a ParticleVec> for Range<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<&'a ParticleVec> for RangeTo<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<&'a ParticleVec> for RangeFrom<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<&'a ParticleVec> for RangeFull[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<&'a ParticleVec> for RangeInclusive<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<&'a ParticleVec> for RangeToInclusive<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndexMut<&'a mut ParticleVec> for usize[src]

type MutOutput = ParticleRefMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<&'a mut ParticleVec> for Range<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeTo<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeFrom<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeFull[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeInclusive<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeToInclusive<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl StructuralPartialEq for ParticleVec[src]

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