[][src]Module heaparray::naive_rc

This module contains naively reference counted arrays, both as atomic and regular versions; i.e. if you're not careful, you could make a cycle that never gets deallocated.

The API for ArcArray and RcArray is the same as for HeapArray, with the caveat that ArcArray::clone() and RcArray::clone() only copy the reference to the data, and leave the data itself untouched.

Additionally, it is more idiomatic to perform reference clones using the ArrayRef trait:

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

Modules

generic

Contains definition for RcArray, which is an implementation-agnositc, reference-counted array.

ref_counters

Utility structs for reference counting.

Structs

FpArcArray

Fat-pointer, atomic implementation of generic::RcArray.

FpRcArray

Fat-pointer, single-threaded implementation of generic::RcArray.

TpArcArray

Thin-pointer, atomic implementation of generic::RcArray.

TpRcArray

Fat-pointer, single-threaded implementation of generic::RcArray.

Traits

Array

Statically-sized array stored in the heap.

ArrayRef

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

AtomicArrayRef

Atomically modified array reference. Guarrantees that all operations on the array reference are atomic (i.e. all changes to the internal array pointer).

BaseArrayRef

A basic reference to a heap-allocated array. Should be paired with exactly one of either heaparray::UnsafeArrayRef or heaparray::ArrayRef.

Container

Trait for a simple container.

CopyMap

Trait for a container indexed by a value that implements Copy and Eq.

DefaultLabelledArray

Trait for a labelled array with a default value.

LabelledArray

Array with an optional label struct stored next to the data.

MakeArray

An array of arbitrary (sized) values that can be safely initialized.

UnsafeArrayRef

A reference to a heap-allocated array whose safe API guarrantees it to always be non-null.