[][src]Struct soa_vec::Soa2

pub struct Soa2<T1: Sized, T2: Sized> { /* fields omitted */ }

Stores slices in a struct-of-arrays style with the API of Vec. The advantage over simply using multiple Vec is that all slices live in a single allocation, there's one shared len/capacity variable, and the API ensures that items are kept together through all operations like push/pop/sort

Methods

impl<T1: Sized, T2: Sized> Soa2<T1, T2>[src]

pub fn new() -> Soa2<T1, T2>[src]

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

pub fn clear(&mut self)[src]

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

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

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

##Panics:

  • Must panic if index is out of bounds

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

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

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

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

Panics

  • If index is >= len

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

Trait Implementations

impl<T1: Sized, T2: Sized> Drop for Soa2<T1, T2>[src]

impl<T1: Clone + Sized, T2: Clone + Sized> Clone for Soa2<T1, T2>[src]

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

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<T1, T2> !Send for Soa2<T1, T2>

impl<T1, T2> !Sync for Soa2<T1, T2>

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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