[−][src]Struct arr::Array
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]
T: Zeroable,
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::Array
s also implement Zeroable allowing for types like [u8; 1 << 25]
.
impl<T> Array<T> where
T: Default + Copy,
[src]
T: Default + Copy,
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]
T: Clone,
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.
fn index<'a>(&'a self, idx: Range<usize>) -> &'a Self::Output
[src]
impl<T> Index<usize> for Array<T>
[src]
type Output = T
The returned type after indexing.
fn index<'a>(&'a self, idx: usize) -> &'a Self::Output
[src]
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,
T: RefUnwindSafe,
impl<T> Unpin for Array<T>
impl<T> UnwindSafe for Array<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,