forall T.
struct Array! { ... }
Exclusive access to a fixed-length run of initialized values in caller-provided storage. into_parts returns that storage to the caller.
Methods
method from_partssource
unsafe fn from_parts(base: *T, len: usize) -> Array![T] { ... }
The array of the len values at base.
Caller: base addresses len initialized Ts that nothing else reads or writes while this array exists.
method into_partssource
fn into_parts(self) -> (*T, usize) { ... }
Ends the array and gives its storage back, with every element in it.
method lensource
fn len(&self) -> usize { ... }
The number of elements.
method setsource
fn set(&self, i: usize, value: T) -> Result[T, T] { ... }
Puts value at i and hands back what was there, or hands value back unplaced when i is out of range. Nothing is dropped either way, so this works for linear elements too.
method getsource
fn get(&self, i: usize) -> Option[T] { ... }
A copy of the element at i, or nothing when i is out of range.
method atsource
fn at(&self, i: usize) -> T { ... }
A copy of the element at i; stops the program (core::process::trap) when i is out of range.