[]Struct lumol::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

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

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

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

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

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> Clone for ParticleSlice<'a>

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

impl<'a> Debug 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?

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> Pointable for T

type Init = T

The type for initializers.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,