[][src]Struct soa_derive_example::ParticleSlice

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

A slice of Particle inside a ParticleVec .

Fields

mass: &'a [f64]

A slice of mass from a ParticleVec

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

A slice of position from a ParticleVec

kind: &'a [usize]

A slice of kind from a ParticleVec

name: &'a [String]

A slice of name from a ParticleVec

Implementations

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

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

Get an iterator over the ParticleRef in this slice.

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

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(&self) -> Option<ParticleRef<'a>>[src]

pub fn split_first(&self) -> Option<(ParticleRef<'a>, ParticleSlice<'a>)>[src]

pub fn last(&self) -> Option<ParticleRef<'a>>[src]

pub fn split_last(&self) -> Option<(ParticleRef<'a>, ParticleSlice<'a>)>[src]

pub fn split_at(&self, mid: usize) -> (ParticleSlice<'a>, ParticleSlice<'a>)[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 std::ops::Index directly since it requires returning a reference.

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

Reborrows the slices in a narrower lifetime

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

pub unsafe fn from_raw_parts<'b>(
    data: ParticlePtr,
    len: usize
) -> ParticleSlice<'b>
[src]

Trait Implementations

impl<'a> Clone for ParticleSlice<'a>[src]

impl<'a> Copy for ParticleSlice<'a>[src]

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

impl<'a> IntoIterator for ParticleSlice<'a>[src]

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?

impl<'a, 'b> IntoIterator for &'a ParticleSlice<'b>[src]

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?

impl<'a> PartialEq<ParticleSlice<'a>> for ParticleSlice<'a>[src]

impl<'a> SoAIndex<ParticleSlice<'a>> for usize[src]

type RefOutput = ParticleRef<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<ParticleSlice<'a>> for Range<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<ParticleSlice<'a>> for RangeTo<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<ParticleSlice<'a>> for RangeFrom<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<ParticleSlice<'a>> for RangeFull[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<ParticleSlice<'a>> for RangeInclusive<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

impl<'a> SoAIndex<ParticleSlice<'a>> for RangeToInclusive<usize>[src]

type RefOutput = ParticleSlice<'a>

The output for the non-mutable functions

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

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]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.