Trait nalgebra::Indexable [] [src]

pub trait Indexable<I, N>: Shape<I> + IndexMut<I, Output=N> {
    fn swap(&mut self, i: I, j: I);
    unsafe fn unsafe_at(&self, i: I) -> N;
    unsafe fn unsafe_set(&mut self, i: I, N);
}

This is a workaround of current Rust limitations.

It exists because the I trait cannot be used to express write access. Thus, this is the same as the I trait but without the syntactic sugar and with a method to write to a specific index.

Required Methods

fn swap(&mut self, i: I, j: I)

Swaps the i-th element of self with its j-th element.

unsafe fn unsafe_at(&self, i: I) -> N

Reads the i-th element of self.

i is not checked.

unsafe fn unsafe_set(&mut self, i: I, N)

Writes to the i-th element of self.

i is not checked.

Implementors