[−]Struct lumol::ParticleSliceMut
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<'_>>
Similar to [Particle] ::first_mut()
.
pub fn split_first_mut(
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>
Similar to [Particle] ::split_first_mut()
.
pub fn last_mut(&mut self) -> Option<ParticleRefMut<'_>>
Similar to [Particle] ::last_mut()
.
pub fn split_last_mut(
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>
&mut self
) -> Option<(ParticleRefMut<'_>, ParticleSliceMut<'_>)>
Similar to [Particle] ::last_mut()
.
pub fn split_at_mut(
&mut self,
mid: usize
) -> (ParticleSliceMut<'_>, ParticleSliceMut<'_>)
&mut self,
mid: usize
) -> (ParticleSliceMut<'_>, ParticleSliceMut<'_>)
Similar to [Particle] ::split_at_mut()
.
pub fn swap(&mut self, a: usize, b: usize)
Similar to [Particle] ::swap()
.
pub fn get<'b, I>(
&'b self,
index: I
) -> Option<<I as SoAIndex<ParticleSlice<'b>>>::RefOutput> where
'a: 'b,
I: SoAIndex<ParticleSlice<'b>>,
&'b self,
index: I
) -> Option<<I as SoAIndex<ParticleSlice<'b>>>::RefOutput> where
'a: 'b,
I: SoAIndex<ParticleSlice<'b>>,
Similar to [Particle] ::get()
.
pub unsafe fn get_unchecked<'b, I>(
&'b self,
index: I
) -> <I as SoAIndex<ParticleSlice<'b>>>::RefOutput where
'a: 'b,
I: SoAIndex<ParticleSlice<'b>>,
&'b self,
index: I
) -> <I as SoAIndex<ParticleSlice<'b>>>::RefOutput where
'a: 'b,
I: SoAIndex<ParticleSlice<'b>>,
Similar to [Particle] ::get_unchecked()
.
pub fn index<'b, I>(
&'b self,
index: I
) -> <I as SoAIndex<ParticleSlice<'b>>>::RefOutput where
'a: 'b,
I: SoAIndex<ParticleSlice<'b>>,
&'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>>,
&'b mut self,
index: I
) -> Option<<I as SoAIndexMut<ParticleSliceMut<'b>>>::MutOutput> where
'a: 'b,
I: SoAIndexMut<ParticleSliceMut<'b>>,
Similar to [Particle] ::get_mut()
.
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>>,
&'b mut self,
index: I
) -> <I as SoAIndexMut<ParticleSliceMut<'b>>>::MutOutput where
'a: 'b,
I: SoAIndexMut<ParticleSliceMut<'b>>,
Similar to [Particle] ::get_unchecked_mut()
.
pub fn index_mut<'b, I>(
&'b mut self,
index: I
) -> <I as SoAIndexMut<ParticleSliceMut<'b>>>::MutOutput where
'a: 'b,
I: SoAIndexMut<ParticleSliceMut<'b>>,
&'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,
'a: 'b,
Returns a non-mutable slice from this mutable slice.
pub fn reborrow<'b>(&'b mut self) -> ParticleSliceMut<'b> where
'a: 'b,
'a: 'b,
Reborrows the slices in a narrower lifetime
pub fn as_ptr(&self) -> ParticlePtr
Similar to [Particle] ::as_ptr()
.
pub fn as_mut_ptr(&mut self) -> ParticlePtrMut
Similar to [Particle] ::as_mut_ptr()
.
pub unsafe fn from_raw_parts_mut<'b>(
data: ParticlePtrMut,
len: usize
) -> ParticleSliceMut<'b>
data: ParticlePtrMut,
len: usize
) -> ParticleSliceMut<'b>
Similar to std::slice::from_raw_parts_mut()
.
impl<'a> ParticleSliceMut<'a>
pub fn to_vec(&self) -> ParticleVec
Similar to [Particle] ::to_vec()
.
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?
pub fn into_iter(self) -> <ParticleSliceMut<'a> as IntoIterator>::IntoIter
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,
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<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?
pub fn into_iter(self) -> I
[src]
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, 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>,