[]Struct lumol::sys::ParticleSlice

pub struct ParticleSlice<'a> {
    pub name: &'a [String],
    pub kind: &'a [ParticleKind],
    pub charge: &'a [f64],
    pub mass: &'a [f64],
    pub position: &'a [Vector3D],
    pub velocity: &'a [Vector3D],
}

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

Methods

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

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

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

Similar to [Particle] ::last().

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

pub fn split_at(&self, mid: usize) -> (ParticleSlice<'a>, ParticleSlice<'a>)

pub fn get(&self, i: usize) -> Option<ParticleRef>

Similar to [Particle] ::get().

pub unsafe fn get_unchecked(&self, i: usize) -> ParticleRef

pub fn as_ptr(&self) -> ParticlePtr

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

impl<'a> ParticleSlice<'a>

pub fn to_vec(&self) -> ParticleVec

impl<'a> ParticleSlice<'a>

pub fn iter(&self) -> Iter

Get an iterator over the ParticleRef in this slice.

Trait Implementations

impl<'a> Copy for ParticleSlice<'a>

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?

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?

impl<'a> Clone for ParticleSlice<'a>

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for ParticleSlice<'a>

Auto Trait Implementations

impl<'a> Send for ParticleSlice<'a>

impl<'a> Sync for ParticleSlice<'a>

Blanket Implementations

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> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]