Trait cgmath::Array1
[−]
[src]
pub trait Array1<Element: Copy>: Index<usize, Output=Element> + IndexMut<usize, Output=Element> {
fn map<F>(&mut self, op: F) -> Self where F: FnMut(Element) -> Element;
fn ptr<'a>(&'a self) -> &'a Element { ... }
fn mut_ptr<'a>(&'a mut self) -> &'a mut Element { ... }
fn swap_elems(&mut self, i: usize, j: usize) { ... }
fn replace_elem(&mut self, i: usize, src: Element) -> Element { ... }
}
An array containing elements of type Element
Required Methods
fn map<F>(&mut self, op: F) -> Self where F: FnMut(Element) -> Element
Apply a function to each element.
Provided Methods
fn ptr<'a>(&'a self) -> &'a Element
Get the pointer to the first element of the array.
fn mut_ptr<'a>(&'a mut self) -> &'a mut Element
Get a mutable pointer to the first element of the array.
fn swap_elems(&mut self, i: usize, j: usize)
Swap the elements at indices i
and j
in-place.
fn replace_elem(&mut self, i: usize, src: Element) -> Element
Replace an element in the array.