pub enum ZeroCopyArray<'a, T> {
Owned(ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>),
Borrowed(ArrayBase<ViewRepr<&'a T>, Dim<[usize; 2]>>),
}Expand description
Zero-copy array wrapper that can hold either owned or borrowed data
Variants§
Owned(ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>)
Owned data
Borrowed(ArrayBase<ViewRepr<&'a T>, Dim<[usize; 2]>>)
Borrowed data
Implementations§
Source§impl<'a, T> ZeroCopyArray<'a, T>
impl<'a, T> ZeroCopyArray<'a, T>
Sourcepub fn from_owned(
array: ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>,
) -> ZeroCopyArray<'a, T>
pub fn from_owned( array: ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>, ) -> ZeroCopyArray<'a, T>
Create from owned array
Sourcepub fn from_borrowed(
view: ArrayBase<ViewRepr<&'a T>, Dim<[usize; 2]>>,
) -> ZeroCopyArray<'a, T>
pub fn from_borrowed( view: ArrayBase<ViewRepr<&'a T>, Dim<[usize; 2]>>, ) -> ZeroCopyArray<'a, T>
Create from borrowed array view
Sourcepub fn into_owned(self) -> ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>where
T: Clone,
pub fn into_owned(self) -> ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>where
T: Clone,
Convert to owned array (may clone if borrowed)
Sourcepub fn is_zero_copy(&self) -> bool
pub fn is_zero_copy(&self) -> bool
Check if this is zero-copy (borrowed)
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for ZeroCopyArray<'a, T>
impl<'a, T> RefUnwindSafe for ZeroCopyArray<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ZeroCopyArray<'a, T>
impl<'a, T> Sync for ZeroCopyArray<'a, T>where
T: Sync,
impl<'a, T> Unpin for ZeroCopyArray<'a, T>
impl<'a, T> UnwindSafe for ZeroCopyArray<'a, T>where
T: RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more