[][src]Trait heaparray::naive_rc::ArrayRef

pub trait ArrayRef: BaseArrayRef + Clone {
    fn clone(ptr: &Self) -> Self { ... }
}

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

Allows for idiomatic cloning of array references:

use heaparray::naive_rc::*;
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);
}

Provided methods

fn clone(ptr: &Self) -> Self

Clones the array reference. Internally just calls its .clone() method.

Loading content...

Implementors

impl<A, R, E, L> ArrayRef for RcArray<A, R, E, L> where
    A: LabelledArray<E, R> + BaseArrayRef,
    R: RefCounter<L>, 
[src]

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

Loading content...