[][src]Struct arr::Array

pub struct Array<T> { /* fields omitted */ }

Methods

impl<T> Array<T>[src]

pub fn iter<'a>(&'a self) -> ArrayIter<'a, T>[src]

Create an immutable iterator over elements in Array.

pub fn to_slice<'a>(&'a self) -> &'a [T][src]

Convert to slice

pub fn to_slice_mut<'a>(&'a mut self) -> &'a mut [T][src]

Convert to mutable slice

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

The length of the array (number of elements T)

impl<T> Array<T> where
    T: Zeroable, 
[src]

pub fn zero(size: usize) -> Self[src]

Extremely fast initialization if all you want is 0's. Note that your type must be Zeroable. The auto-Zeroable types are u8, i8, u16, i16, u32, i32, u64, i64, usize, isize, f32, f64. std::Arrays also implement Zeroable allowing for types like [u8; 1 << 25].

impl<T> Array<T> where
    T: Default + Copy
[src]

pub fn new(size: usize) -> Self[src]

Easy initialization if all you want is your T's default instantiation

impl<T> Array<T> where
    T: Clone
[src]

pub fn new_from_template(size: usize, template: &T) -> Self[src]

More generic initialization instantiating all elements as copies of some template

Trait Implementations

impl<T> Drop for Array<T>[src]

impl<T> Index<Range<usize>> for Array<T>[src]

type Output = [T]

The returned type after indexing.

impl<T> Index<usize> for Array<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<Range<usize>> for Array<T>[src]

impl<T> IndexMut<usize> for Array<T>[src]

impl<'a, T> IntoIterator for &'a Array<T>[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = ArrayIter<'a, T>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter[src]

For now, you can only for loop iterate directly over the reference:

use arr::Array;
let arr: Array<usize> = Array::new(6);
for i in &arr {
    println!("{}", i);
}

impl<T> Send for Array<T>[src]

impl<T> Sync for Array<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Array<T> where
    T: RefUnwindSafe

impl<T> Unpin for Array<T>

impl<T> UnwindSafe for Array<T> where
    T: RefUnwindSafe

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