pub enum CowArray<'a, A, D> {
Borrowed(ArrayView<'a, A, D>),
Owned(Array<A, D>),
}
Expand description
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§
Implementations§
Auto Trait Implementations§
impl<'a, A, D> Freeze for CowArray<'a, A, D>where
D: Freeze,
impl<'a, A, D> RefUnwindSafe for CowArray<'a, A, D>where
D: RefUnwindSafe,
A: RefUnwindSafe,
impl<'a, A, D> Send for CowArray<'a, A, D>
impl<'a, A, D> Sync for CowArray<'a, A, D>
impl<'a, A, D> Unpin for CowArray<'a, A, D>
impl<'a, A, D> UnwindSafe for CowArray<'a, A, D>
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