[−][src]Struct soa_vec::Soa3
Struct of arrays storage with vec API. See module docs for more information.
Methods
impl<T1: Sized, T2: Sized, T3: Sized> Soa3<T1, T2, T3>
[src]
pub fn new() -> Soa3<T1, T2, T3>
[src]
Creates a new Soa with a capacity of 0
pub fn with_capacity(capacity: usize) -> Soa3<T1, T2, T3>
[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))
[src]
Appends a tuple to the back of a soa.
pub fn insert(&mut self, index: usize, value: (T1, T2, T3))
[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)>
[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)
[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)
[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])
[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>)
[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>)
[src]
&mut self
) -> (IterMut<'a, T1>, IterMut<'a, T2>, IterMut<'a, T3>)
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])
[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)
[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), (&T1, &T2, &T3)) -> Ordering>(
&mut self,
f: F
)
[src]
&mut self,
f: F
)
Sorts the soa keeping related data together.
Trait Implementations
impl<T1: Sized, T2: Sized, T3: Sized> Default for Soa3<T1, T2, T3>
[src]
impl<T1: Sized, T2: Sized, T3: Sized> Drop for Soa3<T1, T2, T3>
[src]
impl<T1: Clone + Sized, T2: Clone + Sized, T3: Clone + Sized> Clone for Soa3<T1, T2, T3>
[src]
Auto Trait Implementations
impl<T1, T2, T3> !Sync for Soa3<T1, T2, T3>
impl<T1, T2, T3> Unpin for Soa3<T1, T2, T3> where
T1: Unpin,
T2: Unpin,
T3: Unpin,
T1: Unpin,
T2: Unpin,
T3: Unpin,
impl<T1, T2, T3> !Send for Soa3<T1, T2, T3>
impl<T1, T2, T3> UnwindSafe for Soa3<T1, T2, T3> where
T1: RefUnwindSafe + UnwindSafe,
T2: RefUnwindSafe + UnwindSafe,
T3: RefUnwindSafe + UnwindSafe,
T1: RefUnwindSafe + UnwindSafe,
T2: RefUnwindSafe + UnwindSafe,
T3: RefUnwindSafe + UnwindSafe,
impl<T1, T2, T3> RefUnwindSafe for Soa3<T1, T2, T3> where
T1: RefUnwindSafe,
T2: RefUnwindSafe,
T3: RefUnwindSafe,
T1: RefUnwindSafe,
T2: RefUnwindSafe,
T3: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,