Enum ndarray::CowRepr

source ·
pub enum CowRepr<'a, A> {
    View(ViewRepr<&'a A>),
    Owned(OwnedRepr<A>),
}
Expand description

CowArray’s representation.

Don’t use this type directly—use the type alias CowArray for the array type!

Variants§

§

View(ViewRepr<&'a A>)

Borrowed data.

§

Owned(OwnedRepr<A>)

Owned data.

Implementations§

source§

impl<'a, A> CowRepr<'a, A>

source

pub fn is_view(&self) -> bool

Returns true iff the data is the View variant.

source

pub fn is_owned(&self) -> bool

Returns true iff the data is the Owned variant.

Trait Implementations§

source§

impl<'a, A> RawData for CowRepr<'a, A>

§

type Elem = A

The array element type.
source§

impl<'a, A: 'a, B: 'a> RawDataSubst<B> for CowRepr<'a, A>

§

type Output = CowRepr<'a, B>

The resulting array storage of the same kind but substituted element type
source§

unsafe fn data_subst(self) -> Self::Output

Unsafely translate the data representation from one element representation to another. Read more
source§

impl<'a, A> Data for CowRepr<'a, A>

source§

impl<'a, A> DataMut for CowRepr<'a, A>where A: Clone,

source§

impl<'a, A> RawDataClone for CowRepr<'a, A>where A: Clone,

source§

impl<'a, A> RawDataMut for CowRepr<'a, A>where A: Clone,

Auto Trait Implementations§

§

impl<'a, A> RefUnwindSafe for CowRepr<'a, A>where A: RefUnwindSafe,

§

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

§

impl<'a, A> Sync for CowRepr<'a, A>where A: Sync,

§

impl<'a, A> Unpin for CowRepr<'a, A>

§

impl<'a, A> UnwindSafe for CowRepr<'a, A>where A: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.