pub struct RawStridedRef<'a, T> { /* private fields */ }Expand description
Borrowed raw strided input layout.
Use RawStridedRef::new for checked construction, or
RawStridedRef::new_unchecked when a higher-level compiled plan has
already validated bounds.
Implementations§
Source§impl<'a, T> RawStridedRef<'a, T>
impl<'a, T> RawStridedRef<'a, T>
Sourcepub fn new(
data: &'a [T],
dims: &'a [usize],
strides: &'a [isize],
offset: isize,
) -> Result<RawStridedRef<'a, T>, StridedError>
pub fn new( data: &'a [T], dims: &'a [usize], strides: &'a [isize], offset: isize, ) -> Result<RawStridedRef<'a, T>, StridedError>
Create a raw strided input after validating reachable offsets.
Sourcepub unsafe fn new_unchecked(
data: &'a [T],
dims: &'a [usize],
strides: &'a [isize],
offset: isize,
) -> RawStridedRef<'a, T>
pub unsafe fn new_unchecked( data: &'a [T], dims: &'a [usize], strides: &'a [isize], offset: isize, ) -> RawStridedRef<'a, T>
Create a raw strided input without bounds checking.
§Safety
The caller must ensure every index reachable by dims/strides from
offset lies inside data.
pub fn data(&self) -> &'a [T]
pub fn dims(&self) -> &'a [usize]
pub fn strides(&self) -> &'a [isize]
pub fn offset(&self) -> isize
pub fn ptr(&self) -> *const T
Sourcepub fn as_view(&self) -> StridedView<'a, T>
pub fn as_view(&self) -> StridedView<'a, 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.
Trait Implementations§
Source§impl<'a, T> Clone for RawStridedRef<'a, T>where
T: Clone,
impl<'a, T> Clone for RawStridedRef<'a, T>where
T: Clone,
Source§fn clone(&self) -> RawStridedRef<'a, T>
fn clone(&self) -> RawStridedRef<'a, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a, T> Debug for RawStridedRef<'a, T>where
T: Debug,
impl<'a, T> Debug for RawStridedRef<'a, T>where
T: Debug,
impl<'a, T> Copy for RawStridedRef<'a, T>where
T: Copy,
Auto Trait Implementations§
impl<'a, T> Freeze for RawStridedRef<'a, T>
impl<'a, T> RefUnwindSafe for RawStridedRef<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for RawStridedRef<'a, T>where
T: Sync,
impl<'a, T> Sync for RawStridedRef<'a, T>where
T: Sync,
impl<'a, T> Unpin for RawStridedRef<'a, T>
impl<'a, T> UnsafeUnpin for RawStridedRef<'a, T>
impl<'a, T> UnwindSafe for RawStridedRef<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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