[−][src]Struct heaparray::naive_rc::generic::RcArray
RcArray
is a generic, implementation-agnositc array. It contains
logic for enforcing type safety.
The type parameters are, in order:
A: A struct that acts as a reference to an array.
R: A reference-counting structure, that wraps the label.
E: The elements that this array contains.
L: The label that is associated with this array.
Implementation
Reference counting is done by a struct stored directly next to the data; this means that this struct is a single pointer indirection from its underlying data.
Methods
impl<A, R, E, L> RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
impl<A, R, E, L> RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef + Clone,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef + Clone,
R: RefCounter<L>,
pub fn make_owned(&self) -> A
[src]
Trait Implementations
impl<A, R, E, L> BaseArrayRef for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
impl<A, R, E, L> ArrayRef for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
fn clone(ptr: &Self) -> Self
[src]
Clones the array reference. Internally just calls its .clone()
method. Read more
impl<A, R, E, L> LabelledArray<E, L> for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
fn with_label<F>(label: L, len: usize, func: F) -> Self where
F: FnMut(&mut L, usize) -> E,
[src]
F: FnMut(&mut L, usize) -> E,
unsafe fn with_label_unsafe(label: L, len: usize) -> Self
[src]
fn get_label(&self) -> &L
[src]
unsafe fn get_label_unsafe(&self) -> &mut L
[src]
unsafe fn get_unsafe(&self, idx: usize) -> &mut E
[src]
impl<A, R, E, L> LabelledArrayRefMut<E, L> for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef + LabelledArrayMut<E, R>,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef + LabelledArrayMut<E, R>,
R: RefCounter<L>,
fn get_label_mut(&mut self) -> Option<&mut L>
[src]
impl<A, R, E, L> DefaultLabelledArray<E, L> for RcArray<A, R, E, L> where
A: DefaultLabelledArray<E, R> + LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
E: Default,
[src]
A: DefaultLabelledArray<E, R> + LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
E: Default,
impl<A, R, E> MakeArray<E> for RcArray<A, R, E, ()> where
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<()>,
[src]
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<()>,
impl<A, R, E, L> SliceArrayRef<E> for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef + SliceArray<E>,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef + SliceArray<E>,
R: RefCounter<L>,
impl<A, R, E, L> Send for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef + Send + Sync,
R: RefCounter<L> + Send + Sync,
E: Send + Sync,
L: Send + Sync,
[src]
A: LabelledArray<E, R> + BaseArrayRef + Send + Sync,
R: RefCounter<L> + Send + Sync,
E: Send + Sync,
L: Send + Sync,
impl<A, R, E, L> Drop for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
impl<A, R, E, L> Sync for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef + Sync,
R: RefCounter<L> + Send + Sync,
E: Send + Sync,
L: Send + Sync,
[src]
A: LabelledArray<E, R> + BaseArrayRef + Sync,
R: RefCounter<L> + Send + Sync,
E: Send + Sync,
L: Send + Sync,
impl<A, R, E, L> Clone for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'b, A, R, E, L> IntoIterator for &'b RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef + SliceArray<E>,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef + SliceArray<E>,
R: RefCounter<L>,
type Item = &'b E
The type of the elements being iterated over.
type IntoIter = Iter<'b, E>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<A, R, E, L> Debug for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef + SliceArray<E>,
R: RefCounter<L>,
E: Debug,
L: Debug,
[src]
A: LabelledArray<E, R> + BaseArrayRef + SliceArray<E>,
R: RefCounter<L>,
E: Debug,
L: Debug,
impl<A, R, E, L> Index<usize> for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef + Index<usize, Output = E>,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef + Index<usize, Output = E>,
R: RefCounter<L>,
impl<A, R, E, L> Container for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
impl<A, R, E, L> CopyMap<usize, E> for RcArray<A, R, E, L> where
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
[src]
A: LabelledArray<E, R> + BaseArrayRef,
R: RefCounter<L>,
fn get(&self, key: usize) -> Option<&E>
[src]
Get a reference into this array. Returns None
if:
- The index given is out-of-bounds
fn get_mut(&mut self, key: usize) -> Option<&mut E>
[src]
Get a mutable reference into this array. Returns None
if:
- The array is referenced by another pointer
- The index given is out-of-bounds
fn insert(&mut self, key: usize, value: E) -> Option<E>
[src]
Insert an element into this array. Returns None
if:
- The array is referenced by another pointer
- The index given is out-of-bounds
- There was nothing in the slot previously
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,