[−][src]Struct soa_derive_example::ParticleVec
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]
Similar to Vec<Particle> ::new()
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]
Similar to Vec<Particle> ::push()
.
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]
Similar to Vec<Particle> ::swap_remove()
.
pub fn insert(&mut self, index: usize, element: Particle)
[src]
Similar to Vec<Particle> ::insert()
.
pub fn remove(&mut self, index: usize) -> Particle
[src]
Similar to Vec<Particle> ::remove()
.
pub fn pop(&mut self) -> Option<Particle>
[src]
Similar to Vec<Particle> ::pop()
.
pub fn append(&mut self, other: &mut ParticleVec)
[src]
Similar to Vec<Particle> ::append()
.
pub fn clear(&mut self)
[src]
Similar to Vec<Particle> ::clear()
.
pub fn split_off(&mut self, at: usize) -> ParticleVec
[src]
Similar to Vec<Particle> ::split_off()
.
pub fn as_slice(&self) -> ParticleSlice<'_>
[src]
Similar to Vec<Particle> ::as_slice()
.
pub fn as_mut_slice(&mut self) -> ParticleSliceMut<'_>
[src]
Similar to Vec<Particle> ::as_mut_slice()
.
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]
F: FnMut(ParticleRef<'_>) -> bool,
Similar to Vec<Particle> ::retain()
.
pub fn get<'a, I>(&'a self, index: I) -> Option<I::RefOutput> where
I: SoAIndex<&'a ParticleVec>,
[src]
I: SoAIndex<&'a ParticleVec>,
Similar to Vec<Particle> ::get<I>()
.
pub unsafe fn get_unchecked<'a, I>(&'a self, index: I) -> I::RefOutput where
I: SoAIndex<&'a ParticleVec>,
[src]
I: SoAIndex<&'a ParticleVec>,
Similar to Vec<Particle> ::get_unchecked<I>()
.
pub fn index<'a, I>(&'a self, index: I) -> I::RefOutput where
I: SoAIndex<&'a ParticleVec>,
[src]
I: SoAIndex<&'a ParticleVec>,
Similar to Vec<Particle> ::index<I>()
.
pub fn get_mut<'a, I>(&'a mut self, index: I) -> Option<I::MutOutput> where
I: SoAIndexMut<&'a mut ParticleVec>,
[src]
I: SoAIndexMut<&'a mut ParticleVec>,
Similar to Vec<Particle> ::get_mut<I>()
.
pub unsafe fn get_unchecked_mut<'a, I>(&'a mut self, index: I) -> I::MutOutput where
I: SoAIndexMut<&'a mut ParticleVec>,
[src]
I: SoAIndexMut<&'a mut ParticleVec>,
Similar to Vec<Particle> ::get_unchecked_mut<I>()
.
pub fn index_mut<'a, I>(&'a mut self, index: I) -> I::MutOutput where
I: SoAIndexMut<&'a mut ParticleVec>,
[src]
I: SoAIndexMut<&'a mut ParticleVec>,
Similar to Vec<Particle> ::index_mut<I>()
.
pub fn as_ptr(&self) -> ParticlePtr
[src]
Similar to Vec<Particle> ::as_ptr()
.
pub fn as_mut_ptr(&mut self) -> ParticlePtrMut
[src]
Similar to Vec<Particle> ::as_mut_ptr()
.
pub unsafe fn from_raw_parts(
data: ParticlePtrMut,
len: usize,
capacity: usize
) -> ParticleVec
[src]
data: ParticlePtrMut,
len: usize,
capacity: usize
) -> ParticleVec
Similar to Vec<Particle> ::from_raw_parts()
.
Trait Implementations
impl Debug for ParticleVec
[src]
impl FromIterator<Particle> for ParticleVec
[src]
fn from_iter<T: IntoIterator<Item = Particle>>(iter: T) -> Self
[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?
fn into_iter(self) -> Self::IntoIter
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<ParticleVec> for ParticleVec
[src]
fn eq(&self, other: &ParticleVec) -> bool
[src]
fn ne(&self, other: &ParticleVec) -> bool
[src]
impl<'a> SoAIndex<&'a ParticleVec> for usize
[src]
type RefOutput = ParticleRef<'a>
The output for the non-mutable functions
fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]
unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
impl<'a> SoAIndex<&'a ParticleVec> for Range<usize>
[src]
type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]
unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
impl<'a> SoAIndex<&'a ParticleVec> for RangeTo<usize>
[src]
type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]
unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
impl<'a> SoAIndex<&'a ParticleVec> for RangeFrom<usize>
[src]
type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]
unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
impl<'a> SoAIndex<&'a ParticleVec> for RangeFull
[src]
type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]
unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
impl<'a> SoAIndex<&'a ParticleVec> for RangeInclusive<usize>
[src]
type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]
unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
impl<'a> SoAIndex<&'a ParticleVec> for RangeToInclusive<usize>
[src]
type RefOutput = ParticleSlice<'a>
The output for the non-mutable functions
fn get(self, soa: &'a ParticleVec) -> Option<Self::RefOutput>
[src]
unsafe fn get_unchecked(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
fn index(self, soa: &'a ParticleVec) -> Self::RefOutput
[src]
impl<'a> SoAIndexMut<&'a mut ParticleVec> for usize
[src]
type MutOutput = ParticleRefMut<'a>
The output for the mutable functions
fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]
unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
impl<'a> SoAIndexMut<&'a mut ParticleVec> for Range<usize>
[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]
unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeTo<usize>
[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]
unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeFrom<usize>
[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]
unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeFull
[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]
unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeInclusive<usize>
[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]
unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
impl<'a> SoAIndexMut<&'a mut ParticleVec> for RangeToInclusive<usize>
[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, soa: &'a mut ParticleVec) -> Option<Self::MutOutput>
[src]
unsafe fn get_unchecked_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
fn index_mut(self, soa: &'a mut ParticleVec) -> Self::MutOutput
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,