[][src]Struct soa_vec::Soa5::Soa5

pub struct Soa5<T1: Sized, T2: Sized, T3: Sized, T4: Sized, T5: Sized> { /* fields omitted */ }

Struct of arrays storage with vec API. See module docs for more information.

Methods

impl<T1: Sized, T2: Sized, T3: Sized, T4: Sized, T5: Sized> Soa5<T1, T2, T3, T4, T5>[src]

pub fn new() -> Soa5<T1, T2, T3, T4, T5>[src]

Creates a new Soa with a capacity of 0

pub fn with_capacity(capacity: usize) -> Soa5<T1, T2, T3, T4, T5>[src]

Constructs a new, empty Soa with the specified capacity. The soa will be able to hold exactly capacity elements without reallocating. If capacity is 0, the soa will not allocate. It is important to note that although the returned soa has the capacity specified, the soa will have a zero length.

pub fn len(&self) -> usize[src]

Returns the number of tuples in the soa, also referred to as its 'length'.

pub fn capacity(&self) -> usize[src]

Returns the number of elements the soa can hold without reallocating.

pub fn is_empty(&self) -> bool[src]

Returns true if the soa has a length of 0.

pub fn clear(&mut self)[src]

Clears the soa, removing all values. Note that this method has no effect on the allocated capacity of the soa.

pub fn push(&mut self, value: (T1, T2, T3, T4, T5))[src]

Appends a tuple to the back of a soa.

pub fn insert(&mut self, index: usize, value: (T1, T2, T3, T4, T5))[src]

Inserts an element at position index within each array, shifting all elements after it to the right.

Panics

Must panic if index > len.

pub fn pop(&mut self) -> Option<(T1, T2, T3, T4, T5)>[src]

Removes the last tuple from a soa and returns it, or None if it is empty.

pub fn remove(&mut self, index: usize) -> (T1, T2, T3, T4, T5)[src]

Removes and returns the element at position index within the vector, shifting all elements after it to the left.

Panics

Must panic if index is out of bounds.

pub fn swap_remove(&mut self, index: usize) -> (T1, T2, T3, T4, T5)[src]

Removes a tuple from the soa and returns it. The removed tuple is replaced by the last tuple of the soa. This does not preserve ordering, but is O(1).

Panics:

  • Must panic if index is out of bounds

pub fn slices<'a>(&self) -> (&'a [T1], &'a [T2], &'a [T3], &'a [T4], &'a [T5])[src]

Returns a tuple of all the destructured tuples added to this soa.

pub fn iters<'a>(
    &self
) -> (Iter<'a, T1>, Iter<'a, T2>, Iter<'a, T3>, Iter<'a, T4>, Iter<'a, T5>)
[src]

Returns a tuple of iterators over each field in the soa.

pub fn iters_mut<'a>(
    &mut self
) -> (IterMut<'a, T1>, IterMut<'a, T2>, IterMut<'a, T3>, IterMut<'a, T4>, IterMut<'a, T5>)
[src]

Returns a tuple of mutable iterators over each field in the soa.

pub fn slices_mut<'a>(
    &self
) -> (&'a mut [T1], &'a mut [T2], &'a mut [T3], &'a mut [T4], &'a mut [T5])
[src]

Returns a tuple of all the destructured mutable tuples added to this soa.

pub fn index<'a>(
    &self,
    index: usize
) -> (&'a T1, &'a T2, &'a T3, &'a T4, &'a T5)
[src]

This is analogous to the index operator in vec, but returns a tuple of references.

Panics

  • If index is >= len

pub fn sort_unstable_by<F: FnMut((&T1, &T2, &T3, &T4, &T5), (&T1, &T2, &T3, &T4, &T5)) -> Ordering>(
    &mut self,
    f: F
)
[src]

Sorts the soa keeping related data together.

Important traits for Drain<'a, T1, T2, T3, T4, T5>
pub fn drain<R: RangeBounds<usize>>(
    &mut self,
    range: R
) -> Drain<T1, T2, T3, T4, T5>
[src]

Trait Implementations

impl<T1: Clone + Sized, T2: Clone + Sized, T3: Clone + Sized, T4: Clone + Sized, T5: Clone + Sized> Clone for Soa5<T1, T2, T3, T4, T5>[src]

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

Performs copy-assignment from source. Read more

impl<T1: Sized, T2: Sized, T3: Sized, T4: Sized, T5: Sized> Default for Soa5<T1, T2, T3, T4, T5>[src]

impl<T1: Sized, T2: Sized, T3: Sized, T4: Sized, T5: Sized> Drop for Soa5<T1, T2, T3, T4, T5>[src]

Auto Trait Implementations

impl<T1, T2, T3, T4, T5> !Sync for Soa5<T1, T2, T3, T4, T5>

impl<T1, T2, T3, T4, T5> !Send for Soa5<T1, T2, T3, T4, T5>

impl<T1, T2, T3, T4, T5> Unpin for Soa5<T1, T2, T3, T4, T5> where
    T1: Unpin,
    T2: Unpin,
    T3: Unpin,
    T4: Unpin,
    T5: Unpin

impl<T1, T2, T3, T4, T5> RefUnwindSafe for Soa5<T1, T2, T3, T4, T5> where
    T1: RefUnwindSafe,
    T2: RefUnwindSafe,
    T3: RefUnwindSafe,
    T4: RefUnwindSafe,
    T5: RefUnwindSafe

impl<T1, T2, T3, T4, T5> UnwindSafe for Soa5<T1, T2, T3, T4, T5> where
    T1: RefUnwindSafe + UnwindSafe,
    T2: RefUnwindSafe + UnwindSafe,
    T3: RefUnwindSafe + UnwindSafe,
    T4: RefUnwindSafe + UnwindSafe,
    T5: RefUnwindSafe + UnwindSafe

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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