[][src]Enum rust2vec::storage::CowArray

pub enum CowArray<'a, A, D> {
    Borrowed(ArrayView<'a, A, D>),
    Owned(Array<A, D>),
}

Copy-on-write wrapper for Array/ArrayView.

The CowArray type stores an owned array or an array view. In both cases a view (as_view) or an owned array (into_owned) can be obtained. If the wrapped array is a view, retrieving an owned array will copy the underlying data.

Variants

Borrowed(ArrayView<'a, A, D>)Owned(Array<A, D>)

Methods

impl<'a, A, D> CowArray<'a, A, D> where
    D: Dimension
[src]

pub fn as_view(&self) -> ArrayView<A, D>[src]

impl<'a, A, D> CowArray<'a, A, D> where
    A: Clone,
    D: Dimension
[src]

pub fn into_owned(self) -> Array<A, D>[src]

Auto Trait Implementations

impl<'a, A, D> Send for CowArray<'a, A, D> where
    A: Send + Sync,
    D: Send

impl<'a, A, D> Sync for CowArray<'a, A, D> where
    A: Sync,
    D: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]