Trait linked_array::Array [] [src]

pub trait Array<T> {
    fn get(&self, idx: usize) -> Option<&T>;
fn len() -> usize; unsafe fn as_slice(&self) -> &[T] { ... }
fn size(&self) -> usize { ... } }

A generic trait for arbitarily fixed size arrays.

Required Methods

Access the element at idx, or None if out of bounds.

Get the compile-time length of the array.

Provided Methods

Since the in-memory representation should be the same as a traditional array, it should be safe to read the pointer as one. However, since the rust specification makes memory layout undefined, it is held behind unsafe.

A conveinence wrapper around len that takes a refernce to facilitate using the right type.

Implementors