[][src]Struct soa_derive_example::ParticleSliceMut

pub struct ParticleSliceMut<'a> {
    pub mass: &'a mut [f64],
    pub position: &'a mut [[f64; 3]],
    pub kind: &'a mut [usize],
    pub name: &'a mut [String],
}

A mutable slice of Particle inside a ParticleVec .

Fields

mass: &'a mut [f64]

A mutable slice of mass from a ParticleVec

position: &'a mut [[f64; 3]]

A mutable slice of position from a ParticleVec

kind: &'a mut [usize]

A mutable slice of kind from a ParticleVec

name: &'a mut [String]

A mutable slice of name from a ParticleVec

Implementations

impl<'a> ParticleSliceMut<'a>[src]

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

Get an iterator over the ParticleRef in this vector

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

Get a mutable iterator over the ParticleRefMut in this vector

impl<'a> ParticleSliceMut<'a>[src]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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::MutOutput> where
    I: SoAIndexMut<ParticleSliceMut<'b>>,
    'a: 'b, 
[src]

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

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

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

Returns a non-mutable slice from this mutable slice.

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

Reborrows the slices in a narrower lifetime

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

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

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

Trait Implementations

impl<'a> Debug for ParticleSliceMut<'a>[src]

impl<'a> IntoIterator for ParticleSliceMut<'a>[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<'a> PartialEq<ParticleSliceMut<'a>> for ParticleSliceMut<'a>[src]

impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for usize[src]

type MutOutput = ParticleRefMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for Range<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeTo<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeFrom<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeFull[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeInclusive<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeToInclusive<usize>[src]

type MutOutput = ParticleSliceMut<'a>

The output for the mutable functions

impl<'a> StructuralPartialEq for ParticleSliceMut<'a>[src]

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