#[repr(transparent)]
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 the VolAddress 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 the T 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>

source

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.

source

pub const fn get_frame( self, z: usize ) -> Option<VolGrid2d<T, R, W, WIDTH, HEIGHT>>

Gets a single frame as a VolGrid2d.

Returns None if z is out of bounds.

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>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
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>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
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>

source§

fn cmp( &self, other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE> ) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<T: PartialEq, R: PartialEq, W: PartialEq, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialEq<VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>> 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialOrd, R: PartialOrd, W: PartialOrd, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialOrd<VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>> 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>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<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>

source§

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>

source§

impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> StructuralEq for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>

source§

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> RefUnwindSafe for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>where R: RefUnwindSafe, T: RefUnwindSafe, W: RefUnwindSafe,

§

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>where R: Send, T: Send, W: Send,

§

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>where R: Sync, T: Sync, W: Sync,

§

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>where R: Unpin, T: Unpin, W: Unpin,

§

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>where R: UnwindSafe, T: UnwindSafe, W: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.