[]Struct lumol::sys::ParticleSliceMut

pub struct ParticleSliceMut<'a> {
    pub name: &'a mut [String],
    pub kind: &'a mut [ParticleKind],
    pub charge: &'a mut [f64],
    pub mass: &'a mut [f64],
    pub position: &'a mut [Vector3D],
    pub velocity: &'a mut [Vector3D],
}

A mutable slice of Particle inside a ParticleVec .

Fields

name: &'a mut [String]

A mutable slice of name from a ParticleVec

kind: &'a mut [ParticleKind]

A mutable slice of kind from a ParticleVec

charge: &'a mut [f64]

A mutable slice of charge from a ParticleVec

mass: &'a mut [f64]

A mutable slice of mass from a ParticleVec

position: &'a mut [Vector3D]

A mutable slice of position from a ParticleVec

velocity: &'a mut [Vector3D]

A mutable slice of velocity from a ParticleVec

Implementations

impl<'a> ParticleSliceMut<'a>

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

Convert a ParticleSliceMut to a ParticleSlice in order to be able to use the methods on the non mutable version of the slices.

pub fn len(&self) -> usize

Similar to [Particle] ::len(), the length of all fields should be the same.

pub fn is_empty(&self) -> bool

Similar to [Particle] ::is_empty(), the length of all fields should be the same.

pub fn first_mut(&mut self) -> Option<ParticleRefMut<'_>>

pub fn split_first_mut(
    &mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>

pub fn last_mut(&mut self) -> Option<ParticleRefMut<'_>>

pub fn split_last_mut(
    &mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>

pub fn split_at_mut(
    &mut self,
    mid: usize
) -> (ParticleSliceMut<'_>, ParticleSliceMut<'_>)

pub fn swap(&mut self, a: usize, b: usize)

pub fn get<'b, I>(
    &'b self,
    index: I
) -> Option<<I as SoAIndex<ParticleSlice<'b>>>::RefOutput> where
    'a: 'b,
    I: SoAIndex<ParticleSlice<'b>>, 

pub unsafe fn get_unchecked<'b, I>(
    &'b self,
    index: I
) -> <I as SoAIndex<ParticleSlice<'b>>>::RefOutput where
    'a: 'b,
    I: SoAIndex<ParticleSlice<'b>>, 

pub fn index<'b, I>(
    &'b self,
    index: I
) -> <I as SoAIndex<ParticleSlice<'b>>>::RefOutput where
    'a: 'b,
    I: SoAIndex<ParticleSlice<'b>>, 

Similar to std::ops::Index trait on Particle . This is required because we cannot implement that trait.

pub fn get_mut<'b, I>(
    &'b mut self,
    index: I
) -> Option<<I as SoAIndexMut<ParticleSliceMut<'b>>>::MutOutput> where
    'a: 'b,
    I: SoAIndexMut<ParticleSliceMut<'b>>, 

pub unsafe fn get_unchecked_mut<'b, I>(
    &'b mut self,
    index: I
) -> <I as SoAIndexMut<ParticleSliceMut<'b>>>::MutOutput where
    'a: 'b,
    I: SoAIndexMut<ParticleSliceMut<'b>>, 

pub fn index_mut<'b, I>(
    &'b mut self,
    index: I
) -> <I as SoAIndexMut<ParticleSliceMut<'b>>>::MutOutput where
    'a: 'b,
    I: SoAIndexMut<ParticleSliceMut<'b>>, 

Similar to std::ops::IndexMut trait on Particle . This is required because we cannot implement std::ops::IndexMut directly since it requires returning a mutable reference.

pub fn as_slice<'b>(&'b self) -> ParticleSlice<'b> where
    'a: 'b, 

Returns a non-mutable slice from this mutable slice.

pub fn reborrow<'b>(&'b mut self) -> ParticleSliceMut<'b> where
    'a: 'b, 

Reborrows the slices in a narrower lifetime

pub fn as_ptr(&self) -> ParticlePtr

pub fn as_mut_ptr(&mut self) -> ParticlePtrMut

pub unsafe fn from_raw_parts_mut<'b>(
    data: ParticlePtrMut,
    len: usize
) -> ParticleSliceMut<'b>

impl<'a> ParticleSliceMut<'a>

pub fn to_vec(&self) -> ParticleVec

impl<'a> ParticleSliceMut<'a>

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

Get an iterator over the ParticleRef in this vector

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

Get a mutable iterator over the ParticleRefMut in this vector

Trait Implementations

impl<'a> Debug for ParticleSliceMut<'a>

impl<'a> IntoIterator for ParticleSliceMut<'a>

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<'a> RefUnwindSafe for ParticleSliceMut<'a>

impl<'a> Send for ParticleSliceMut<'a>

impl<'a> Sync for ParticleSliceMut<'a>

impl<'a> Unpin for ParticleSliceMut<'a>

impl<'a> !UnwindSafe for ParticleSliceMut<'a>

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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Pointable for T

type Init = T

The type for initializers.

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