[−]Struct lumol::ParticleSlice
A slice of
Particle
inside a
ParticleVec
.
Fields
name: &'a [String]
A slice of name
from a ParticleVec
kind: &'a [ParticleKind]
A slice of kind
from a ParticleVec
charge: &'a [f64]
A slice of charge
from a ParticleVec
mass: &'a [f64]
A slice of mass
from a ParticleVec
position: &'a [Vector3D]
A slice of position
from a ParticleVec
velocity: &'a [Vector3D]
A slice of velocity
from a ParticleVec
Implementations
impl<'a> ParticleSlice<'a>
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(&self) -> Option<ParticleRef<'a>>
Similar to [Particle] ::first()
.
pub fn split_first(&self) -> Option<(ParticleRef<'a>, ParticleSlice<'a>)>
Similar to [Particle] ::split_first()
.
pub fn last(&self) -> Option<ParticleRef<'a>>
Similar to [Particle] ::last()
.
pub fn split_last(&self) -> Option<(ParticleRef<'a>, ParticleSlice<'a>)>
Similar to [Particle] ::split_last()
.
pub fn split_at(&self, mid: usize) -> (ParticleSlice<'a>, ParticleSlice<'a>)
Similar to [Particle] ::split_at()
.
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 std::ops::Index
directly since it requires returning a reference.
pub fn reborrow<'b>(&'b self) -> ParticleSlice<'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 unsafe fn from_raw_parts<'b>(
data: ParticlePtr,
len: usize
) -> ParticleSlice<'b>
data: ParticlePtr,
len: usize
) -> ParticleSlice<'b>
Similar to std::slice::from_raw_parts()
.
impl<'a> ParticleSlice<'a>
pub fn to_vec(&self) -> ParticleVec
Similar to [Particle] ::to_vec()
.
impl<'a> ParticleSlice<'a>
pub fn iter(&self) -> Iter<'_>
Get an iterator over the
ParticleRef
in this slice.
Trait Implementations
impl<'a> Clone for ParticleSlice<'a>
pub fn clone(&self) -> ParticleSlice<'a>
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Copy for ParticleSlice<'a>
impl<'a> Debug for ParticleSlice<'a>
impl<'a> IntoIterator for ParticleSlice<'a>
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) -> <ParticleSlice<'a> as IntoIterator>::IntoIter
impl<'a, 'b> IntoIterator for &'a ParticleSlice<'b>
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 ParticleSlice<'b> as IntoIterator>::IntoIter
Auto Trait Implementations
impl<'a> RefUnwindSafe for ParticleSlice<'a>
impl<'a> Send for ParticleSlice<'a>
impl<'a> Sync for ParticleSlice<'a>
impl<'a> Unpin for ParticleSlice<'a>
impl<'a> UnwindSafe for ParticleSlice<'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> 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>,