pub struct RawStridedMut<'a, T> { /* private fields */ }Expand description
Borrowed raw strided output layout.
This is the mutable counterpart to RawStridedRef. It avoids allocating
owned shape/stride metadata in prepared replay paths.
Implementations§
Source§impl<'a, T> RawStridedMut<'a, T>
impl<'a, T> RawStridedMut<'a, T>
Sourcepub fn new(
data: &'a mut [T],
dims: &'a [usize],
strides: &'a [isize],
offset: isize,
) -> Result<RawStridedMut<'a, T>, StridedError>
pub fn new( data: &'a mut [T], dims: &'a [usize], strides: &'a [isize], offset: isize, ) -> Result<RawStridedMut<'a, T>, StridedError>
Create a raw strided output after validating reachable offsets.
Sourcepub unsafe fn new_unchecked(
data: &'a mut [T],
dims: &'a [usize],
strides: &'a [isize],
offset: isize,
) -> RawStridedMut<'a, T>
pub unsafe fn new_unchecked( data: &'a mut [T], dims: &'a [usize], strides: &'a [isize], offset: isize, ) -> RawStridedMut<'a, T>
Create a raw strided output without bounds checking.
§Safety
The caller must ensure every index reachable by dims/strides from
offset lies inside data, and no aliases violate mutable access.
pub fn data(&self) -> &[T]
pub fn data_mut(&mut self) -> &mut [T]
pub fn dims(&self) -> &'a [usize]
pub fn strides(&self) -> &'a [isize]
pub fn offset(&self) -> isize
pub fn ptr(&self) -> *const T
pub fn as_mut_ptr(&mut self) -> *mut T
Sourcepub fn as_view(&self) -> StridedView<'_, T>
pub fn as_view(&self) -> StridedView<'_, T>
Convert to an immutable owning-metadata view.
This is for compatibility paths. Hot prepared paths should use the raw accessors directly and avoid this conversion.
Sourcepub fn as_view_mut(&mut self) -> StridedViewMut<'_, T>
pub fn as_view_mut(&mut self) -> StridedViewMut<'_, T>
Convert to a mutable owning-metadata view.
This is for compatibility paths. Hot prepared paths should use the raw accessors directly and avoid this conversion.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for RawStridedMut<'a, T>
impl<'a, T> RefUnwindSafe for RawStridedMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for RawStridedMut<'a, T>where
T: Send,
impl<'a, T> Sync for RawStridedMut<'a, T>where
T: Sync,
impl<'a, T> Unpin for RawStridedMut<'a, T>
impl<'a, T> UnsafeUnpin for RawStridedMut<'a, T>
impl<'a, T> !UnwindSafe for RawStridedMut<'a, T>
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