Type Alias ndarray::ArcArray

source ·
pub type ArcArray<A, D> = ArrayBase<OwnedArcRepr<A>, D>;
Expand description

An array where the data has shared ownership and is copy on write.

The ArcArray<A, D> is parameterized by A for the element type and D for the dimensionality.

It can act as both an owner as the data as well as a shared reference (view like). Calling a method for mutating elements on ArcArray, for example view_mut() or get_mut(), will break sharing and require a clone of the data (if it is not uniquely held).

ArcArray uses atomic reference counting like Arc, so it is Send and Sync (when allowed by the element type of the array too).

ArrayBase is used to implement both the owned arrays and the views; see its docs for an overview of all array features.

See also:

Aliased Type§

struct ArcArray<A, D> { /* private fields */ }

Implementations§

source§

impl<A, D> ArcArray<A, D>
where D: Dimension,

Methods specific to ArcArray.

See also all methods for ArrayBase

source

pub fn is_unique(&self) -> bool

Returns true iff the inner Arc is not shared. If you want to ensure the Arc is not concurrently cloned, you need to provide a &mut self to this function.

Trait Implementations§

source§

impl<A, D> From<ArrayBase<OwnedRepr<A>, D>> for ArcArray<A, D>
where D: Dimension,

source§

fn from(arr: Array<A, D>) -> ArcArray<A, D>

Converts to this type from the input type.
source§

impl<A, D> IntoIterator for ArcArray<A, D>
where D: Dimension, A: Clone,

§

type Item = A

The type of the elements being iterated over.
§

type IntoIter = IntoIter<A, D>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, A, D> IntoParallelIterator for &'a ArcArray<A, D>
where D: Dimension, A: Sync,

Requires crate feature rayon.

§

type Item = &'a A

The type of item that the parallel iterator will produce.
§

type Iter = Parallel<ArrayBase<ViewRepr<&'a A>, D>>

The parallel iterator type that will be created.
source§

fn into_par_iter(self) -> Self::Iter

Converts self into a parallel iterator. Read more
source§

impl<'a, A, D> IntoParallelIterator for &'a mut ArcArray<A, D>
where D: Dimension, A: Sync + Send + Clone,

Requires crate feature rayon.

§

type Item = &'a mut A

The type of item that the parallel iterator will produce.
§

type Iter = Parallel<ArrayBase<ViewRepr<&'a mut A>, D>>

The parallel iterator type that will be created.
source§

fn into_par_iter(self) -> Self::Iter

Converts self into a parallel iterator. Read more