[][src]Trait heaparray::ArrayRef

pub trait ArrayRef: BaseArrayRef + Clone {
    fn to_null(&mut self);
fn null_ref() -> Self; fn clone(ptr: &Self) -> Self { ... } }

A reference to an array, whose clone points to the same data.

Allows for idiomatic cloning of array references:

let array_ref = FpRcArray::new(10, |_| 0);
let another_ref = ArrayRef::clone(&array_ref);

assert!(array_ref.len() == another_ref.len());
for i in 0..another_ref.len() {
    let r1 = &array_ref[i] as *const i32;
    let r2 = &another_ref[i] as *const i32;
    assert!(r1 == r2);
}

Required methods

fn to_null(&mut self)

fn null_ref() -> Self

Loading content...

Provided methods

fn clone(ptr: &Self) -> Self

Loading content...

Implementors

impl<'a, A, R, B: ?Sized, E, L> ArrayRef for RcArray<'a, A, R, B, E, L> where
    A: 'a + LabelledArray<'a, E, R> + BaseArrayRef + UnsafeArrayRef<'a, B>,
    R: 'a + RefCounter<L>,
    L: 'a,
    E: 'a,
    B: 'a, 
[src]

fn clone(ptr: &Self) -> Self[src]

impl<'a, E, L> ArrayRef for FpArcArray<'a, E, L>[src]

fn clone(ptr: &Self) -> Self[src]

impl<'a, E, L> ArrayRef for FpRcArray<'a, E, L>[src]

fn clone(ptr: &Self) -> Self[src]

impl<'a, E, L> ArrayRef for TpArcArray<'a, E, L>[src]

fn clone(ptr: &Self) -> Self[src]

impl<'a, E, L> ArrayRef for TpRcArray<'a, E, L>[src]

fn clone(ptr: &Self) -> Self[src]

Loading content...