[−][src]Struct soa_derive_example::ParticleSliceMut
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]
Similar to [Particle] ::first_mut().
pub fn split_first_mut(
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>[src]
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>
Similar to [Particle] ::split_first_mut().
pub fn last_mut(&mut self) -> Option<ParticleRefMut<'_>>[src]
Similar to [Particle] ::last_mut().
pub fn split_last_mut(
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>[src]
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>
Similar to [Particle] ::last_mut().
pub fn split_at_mut(
&mut self,
mid: usize
) -> (ParticleSliceMut<'_>, ParticleSliceMut<'_>)[src]
&mut self,
mid: usize
) -> (ParticleSliceMut<'_>, ParticleSliceMut<'_>)
Similar to [Particle] ::split_at_mut().
pub fn swap(&mut self, a: usize, b: usize)[src]
Similar to [Particle] ::swap().
pub fn get<'b, I>(&'b self, index: I) -> Option<I::RefOutput> where
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b, [src]
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b,
Similar to [Particle] ::get().
pub unsafe fn get_unchecked<'b, I>(&'b self, index: I) -> I::RefOutput where
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b, [src]
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b,
Similar to [Particle] ::get_unchecked().
pub fn index<'b, I>(&'b self, index: I) -> I::RefOutput where
I: SoAIndex<ParticleSlice<'b>>,
'a: 'b, [src]
I: SoAIndex<ParticleSlice<'b>>,
'a: '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::MutOutput> where
I: SoAIndexMut<ParticleSliceMut<'b>>,
'a: 'b, [src]
I: SoAIndexMut<ParticleSliceMut<'b>>,
'a: 'b,
Similar to [Particle] ::get_mut().
pub unsafe fn get_unchecked_mut<'b, I>(&'b mut self, index: I) -> I::MutOutput where
I: SoAIndexMut<ParticleSliceMut<'b>>,
'a: 'b, [src]
I: SoAIndexMut<ParticleSliceMut<'b>>,
'a: 'b,
Similar to [Particle] ::get_unchecked_mut().
pub fn index_mut<'b, I>(&'b mut self, index: I) -> I::MutOutput where
I: SoAIndexMut<ParticleSliceMut<'b>>,
'a: 'b, [src]
I: SoAIndexMut<ParticleSliceMut<'b>>,
'a: '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, [src]
'a: 'b,
Returns a non-mutable slice from this mutable slice.
pub fn reborrow<'b>(&'b mut self) -> ParticleSliceMut<'b> where
'a: 'b, [src]
'a: 'b,
Reborrows the slices in a narrower lifetime
pub fn as_ptr(&self) -> ParticlePtr[src]
Similar to [Particle] ::as_ptr().
pub fn as_mut_ptr(&mut self) -> ParticlePtrMut[src]
Similar to [Particle] ::as_mut_ptr().
pub unsafe fn from_raw_parts_mut<'b>(
data: ParticlePtrMut,
len: usize
) -> ParticleSliceMut<'b>[src]
data: ParticlePtrMut,
len: usize
) -> ParticleSliceMut<'b>
Similar to std::slice::from_raw_parts_mut().
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?
fn into_iter(self) -> Self::IntoIter[src]
impl<'a> PartialEq<ParticleSliceMut<'a>> for ParticleSliceMut<'a>[src]
fn eq(&self, other: &ParticleSliceMut<'a>) -> bool[src]
fn ne(&self, other: &ParticleSliceMut<'a>) -> bool[src]
impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for usize[src]
type MutOutput = ParticleRefMut<'a>
The output for the mutable functions
fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>[src]
unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput[src]
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput[src]
impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for Range<usize>[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>[src]
unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput[src]
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput[src]
impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeTo<usize>[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>[src]
unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput[src]
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput[src]
impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeFrom<usize>[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>[src]
unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput[src]
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput[src]
impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeFull[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>[src]
unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput[src]
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput[src]
impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeInclusive<usize>[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>[src]
unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput[src]
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput[src]
impl<'a> SoAIndexMut<ParticleSliceMut<'a>> for RangeToInclusive<usize>[src]
type MutOutput = ParticleSliceMut<'a>
The output for the mutable functions
fn get_mut(self, slice: ParticleSliceMut<'a>) -> Option<Self::MutOutput>[src]
unsafe fn get_unchecked_mut(
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput[src]
self,
slice: ParticleSliceMut<'a>
) -> Self::MutOutput
fn index_mut(self, slice: ParticleSliceMut<'a>) -> Self::MutOutput[src]
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]
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<I> IntoIterator for I where
I: Iterator, [src]
I: Iterator,
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?
fn into_iter(self) -> I[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.
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>,