pub enum StridedData<'a, T> {
Owned(StridedArray<T>),
View(StridedView<'a, T>),
}Expand description
Type-erased strided data that can be either owned or borrowed.
Variants§
Owned(StridedArray<T>)
View(StridedView<'a, T>)
Implementations§
Source§impl<'a, T> StridedData<'a, T>
impl<'a, T> StridedData<'a, T>
Sourcepub fn as_view(&self) -> StridedView<'_, T>
pub fn as_view(&self) -> StridedView<'_, T>
Return an immutable strided view over the data.
Sourcepub fn as_array(&self) -> &StridedArray<T>
pub fn as_array(&self) -> &StridedArray<T>
Source§impl<'a, T> StridedData<'a, T>
impl<'a, T> StridedData<'a, T>
Source§impl<'a, T> StridedData<'a, T>
impl<'a, T> StridedData<'a, T>
Sourcepub fn into_array(self) -> StridedArray<T>
pub fn into_array(self) -> StridedArray<T>
Convert into an owned StridedArray.
If already owned, returns the inner array directly. If a view, copies the data into a new column-major array.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for StridedData<'a, T>
impl<'a, T> RefUnwindSafe for StridedData<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for StridedData<'a, T>where
T: Send,
impl<'a, T> Sync for StridedData<'a, T>where
T: Sync,
impl<'a, T> Unpin for StridedData<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for StridedData<'a, T>where
T: RefUnwindSafe + UnwindSafe,
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
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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