Struct voladdress::VolGrid2dStrided
source · pub struct VolGrid2dStrided<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> { /* private fields */ }
Expand description
Models having many “frames” of VolGrid2d
within a chunk of memory.
Each frame may or may not overlap, according to the stride specified.
- If the byte stride per frame is less than the byte size of a frame, the frames will have some amount of overlap.
- If the stride bytes equals the frame bytes, then each frame will directly follow the previous one.
- If the stride bytes exceeds the frame bytes, then there will be some amount of gap between frames.
§Generic Parameters
T
/R
/W
: These parameters are applied to theVolAddress
type returned when accessing the block in any way (indexing, iteration, etc).WIDTH
/HEIGHT
: the width and height of a given frame.FRAMES
: the number of frames.BYTE_STRIDE
: The number of bytes between the start of each frame.
§Safety
- This type stores a base
VolAddress
internally, and so you must follow all of those safety rules. Notably, the base address must never be zero. - The address space must legally contain
WIDTH * HEIGHT * FRAMES
contiguous values of theT
type, starting from the base address. - The memory block must not wrap around past the end of the address space.
Implementations§
source§impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
sourcepub const unsafe fn new(address: usize) -> Self
pub const unsafe fn new(address: usize) -> Self
A VolAddress
with multi-frame access pattern.
§Safety
The given address must be a valid for WIDTH * HEIGHT
elements per frame,
at frame indexes 0..FRAMES
, with all non-zero frame indexes being offset
by BYTE_STRIDE
bytes from the previous frame.
Trait Implementations§
source§impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Clone for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Clone for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§impl<T: Hash, R: Hash, W: Hash, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Hash for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T: Hash, R: Hash, W: Hash, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Hash for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§impl<T: Ord, R: Ord, W: Ord, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Ord for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T: Ord, R: Ord, W: Ord, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Ord for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§fn cmp(
&self,
other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
) -> Ordering
fn cmp( &self, other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE> ) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq, R: PartialEq, W: PartialEq, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialEq for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T: PartialEq, R: PartialEq, W: PartialEq, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialEq for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§fn eq(
&self,
other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
) -> bool
fn eq( &self, other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE> ) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd, R: PartialOrd, W: PartialOrd, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialOrd for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T: PartialOrd, R: PartialOrd, W: PartialOrd, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialOrd for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§fn partial_cmp(
&self,
other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
) -> Option<Ordering>
fn partial_cmp( &self, other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE> ) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Copy for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T: Eq, R: Eq, W: Eq, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Eq for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> StructuralPartialEq for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
Auto Trait Implementations§
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Freeze for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> RefUnwindSafe for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Send for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Sync for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Unpin for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> UnwindSafe for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
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