[−]Struct lumol::sys::ParticleVec
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
Similar to Vec<Particle> ::new()
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)
Similar to Vec<Particle> ::push().
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
Similar to Vec<Particle> ::swap_remove().
pub fn insert(&mut self, index: usize, element: Particle)
Similar to Vec<Particle> ::insert().
pub fn remove(&mut self, index: usize) -> Particle
Similar to Vec<Particle> ::remove().
pub fn pop(&mut self) -> Option<Particle>
Similar to Vec<Particle> ::pop().
pub fn append(&mut self, other: &mut ParticleVec)
Similar to Vec<Particle> ::append().
pub fn clear(&mut self)
Similar to Vec<Particle> ::clear().
pub fn split_off(&mut self, at: usize) -> ParticleVec
Similar to Vec<Particle> ::split_off().
pub fn as_slice(&self) -> ParticleSlice<'_>
Similar to Vec<Particle> ::as_slice().
pub fn as_mut_slice(&mut self) -> ParticleSliceMut<'_>
Similar to Vec<Particle> ::as_mut_slice().
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,
F: FnMut(ParticleRef<'_>) -> bool,
Similar to Vec<Particle> ::retain().
pub fn get<'a, I>(
&'a self,
index: I
) -> Option<<I as SoAIndex<&'a ParticleVec>>::RefOutput> where
I: SoAIndex<&'a ParticleVec>,
&'a self,
index: I
) -> Option<<I as SoAIndex<&'a ParticleVec>>::RefOutput> where
I: SoAIndex<&'a ParticleVec>,
Similar to Vec<Particle> ::get<I>().
pub unsafe fn get_unchecked<'a, I>(
&'a self,
index: I
) -> <I as SoAIndex<&'a ParticleVec>>::RefOutput where
I: SoAIndex<&'a ParticleVec>,
&'a self,
index: I
) -> <I as SoAIndex<&'a ParticleVec>>::RefOutput where
I: SoAIndex<&'a ParticleVec>,
Similar to Vec<Particle> ::get_unchecked<I>().
pub fn index<'a, I>(
&'a self,
index: I
) -> <I as SoAIndex<&'a ParticleVec>>::RefOutput where
I: SoAIndex<&'a ParticleVec>,
&'a self,
index: I
) -> <I as SoAIndex<&'a ParticleVec>>::RefOutput where
I: SoAIndex<&'a ParticleVec>,
Similar to Vec<Particle> ::index<I>().
pub fn get_mut<'a, I>(
&'a mut self,
index: I
) -> Option<<I as SoAIndexMut<&'a mut ParticleVec>>::MutOutput> where
I: SoAIndexMut<&'a mut ParticleVec>,
&'a mut self,
index: I
) -> Option<<I as SoAIndexMut<&'a mut ParticleVec>>::MutOutput> where
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 as SoAIndexMut<&'a mut ParticleVec>>::MutOutput where
I: SoAIndexMut<&'a mut ParticleVec>,
&'a mut self,
index: I
) -> <I as SoAIndexMut<&'a mut ParticleVec>>::MutOutput where
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 as SoAIndexMut<&'a mut ParticleVec>>::MutOutput where
I: SoAIndexMut<&'a mut ParticleVec>,
&'a mut self,
index: I
) -> <I as SoAIndexMut<&'a mut ParticleVec>>::MutOutput where
I: SoAIndexMut<&'a mut ParticleVec>,
Similar to Vec<Particle> ::index_mut<I>().
pub fn as_ptr(&self) -> ParticlePtr
Similar to Vec<Particle> ::as_ptr().
pub fn as_mut_ptr(&mut self) -> ParticlePtrMut
Similar to Vec<Particle> ::as_mut_ptr().
pub unsafe fn from_raw_parts(
data: ParticlePtrMut,
len: usize,
capacity: usize
) -> ParticleVec
data: ParticlePtrMut,
len: usize,
capacity: usize
) -> ParticleVec
Similar to Vec<Particle> ::from_raw_parts().
impl ParticleVec
pub fn resize<T>(&mut self, new_len: usize, value: Particle)
Similar to Vec<Particle> ::resize().
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
pub fn clone(&self) -> ParticleVec
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for ParticleVec
impl FromIterator<Particle> for ParticleVec
pub fn from_iter<T>(iter: T) -> ParticleVec where
T: IntoIterator<Item = Particle>,
T: IntoIterator<Item = Particle>,
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?
pub fn into_iter(self) -> <&'a mut ParticleVec as IntoIterator>::IntoIter
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?
pub fn into_iter(self) -> <&'a ParticleVec as IntoIterator>::IntoIter
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,
pub 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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,