pub struct RcArray<A, R, E, L = ()>where
A: LabelledArray<E, R>,
R: RefCounter<L>,{ /* private fields */ }
Expand description
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. Note that this
*can be the label itself*. It just needs to have defined ways of incrementing
and decrementing its reference count.
E: The elements that this array contains.
L: The label that is associated with this array.
Implementations§
Source§impl<A, R, E, L> RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
impl<A, R, E, L> RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
Source§impl<A, R, E, L> RcArray<A, R, E, L>
impl<A, R, E, L> RcArray<A, R, E, L>
Sourcepub fn make_owned(self) -> A
pub fn make_owned(self) -> A
Returns an owned version of this array if the caller has exclusive access, or copies the data otherwise.
Trait Implementations§
Source§impl<A, R, E, L> ArrayRef for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
impl<A, R, E, L> ArrayRef for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
Source§impl<A, R, E, L> Clone for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
impl<A, R, E, L> Clone for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
Source§impl<A, R, E, L> Container for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
impl<A, R, E, L> Container for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
Source§impl<A, R, E, L> CopyMap<usize, E> for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
impl<A, R, E, L> CopyMap<usize, E> for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
Source§fn get(&self, key: usize) -> Option<&E>
fn get(&self, key: usize) -> Option<&E>
Get a reference into this array. Returns None
if:
- The index given is out-of-bounds
Source§impl<A, R, E, L> DefaultLabelledArray<E, L> for RcArray<A, R, E, L>
impl<A, R, E, L> DefaultLabelledArray<E, L> for RcArray<A, R, E, L>
Source§impl<A, R, E, L> Drop for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
impl<A, R, E, L> Drop for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
Source§impl<'b, A, R, E, L> IntoIterator for &'b RcArray<A, R, E, L>
impl<'b, A, R, E, L> IntoIterator for &'b RcArray<A, R, E, L>
Source§impl<A, R, E, L> LabelledArray<E, L> for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
impl<A, R, E, L> LabelledArray<E, L> for RcArray<A, R, E, L>where
A: LabelledArray<E, R>,
R: RefCounter<L>,
Source§fn with_label<F>(label: L, len: usize, func: F) -> Self
fn with_label<F>(label: L, len: usize, func: F) -> Self
Create a new array, with values initialized using a provided
function, and label initialized to a provided value.
Source§unsafe fn get_unchecked(&self, idx: usize) -> &E
unsafe fn get_unchecked(&self, idx: usize) -> &E
Get a reference to the element at a specified index.
Implementations of this method shouldn’t do any safety checks.
Source§impl<A, R, E, L> SliceArray<E> for RcArray<A, R, E, L>
impl<A, R, E, L> SliceArray<E> for RcArray<A, R, E, L>
impl<A, R, E, L> Send for RcArray<A, R, E, L>where
A: LabelledArray<E, R> + Send + Sync,
R: RefCounter<L> + Send + Sync,
E: Send + Sync,
L: Send + Sync,
impl<A, R, E, L> Sync for RcArray<A, R, E, L>where
A: LabelledArray<E, R> + Send + Sync,
R: RefCounter<L> + Send + Sync,
E: Send + Sync,
L: Send + Sync,
Auto Trait Implementations§
impl<A, R, E, L> Freeze for RcArray<A, R, E, L>where
A: Freeze,
impl<A, R, E, L> RefUnwindSafe for RcArray<A, R, E, L>
impl<A, R, E, L> Unpin for RcArray<A, R, E, L>
impl<A, R, E, L> UnwindSafe for RcArray<A, R, E, L>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more