Type Alias Extent3d

Source
pub type Extent3d<T> = Extent<T, 3>;
Expand description

A 3-dimensional Extent.

Aliased Type§

struct Extent3d<T> {
    pub size: [T; 3],
}

Fields§

§size: [T; 3]

The D-dimensional size.

Implementations§

Source§

impl<T> Extent3d<T>

Source

pub const fn x(self) -> T
where T: Copy,

Returns a copy of the first dimension x.

Source

pub const fn y(self) -> T
where T: Copy,

Returns a copy of the second dimension y.

Source

pub const fn z(self) -> T
where T: Copy,

Returns a copy of the third dimension z.

Source

pub const fn x_ref(&self) -> &T

Returns a shared reference to the first dimension x.

Source

pub const fn y_ref(&self) -> &T

Returns a shared reference to the second dimension y.

Source

pub const fn z_ref(&self) -> &T

Returns a shared reference to the third dimension z.

Source

pub fn x_mut(&mut self) -> &mut T

Returns an exclusive reference to the first dimension x.

Source

pub fn y_mut(&mut self) -> &mut T

Returns an exclusive reference to the second dimension y.

Source

pub fn z_mut(&mut self) -> &mut T

Returns an exclusive reference to the third dimension z.

Source

pub fn is_uniform_3d(&self) -> bool
where T: PartialEq,

Returns true if the 3 dimensions of the extent are equal.

Source§

impl Extent3d<i8>

Source

pub const fn c_volume(self) -> i8

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> i8

The surface area of the 3d extent.

Source§

impl Extent3d<i16>

Source

pub const fn c_volume(self) -> i16

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> i16

The surface area of the 3d extent.

Source§

impl Extent3d<i32>

Source

pub const fn c_volume(self) -> i32

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> i32

The surface area of the 3d extent.

Source§

impl Extent3d<i64>

Source

pub const fn c_volume(self) -> i64

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> i64

The surface area of the 3d extent.

Source§

impl Extent3d<i128>

Source

pub const fn c_volume(self) -> i128

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> i128

The surface area of the 3d extent.

Source§

impl Extent3d<isize>

Source

pub const fn c_volume(self) -> isize

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> isize

The surface area of the 3d extent.

Source§

impl Extent3d<u8>

Source

pub const fn c_volume(self) -> u8

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> u8

The surface area of the 3d extent.

Source§

impl Extent3d<u16>

Source

pub const fn c_volume(self) -> u16

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> u16

The surface area of the 3d extent.

Source§

impl Extent3d<u32>

Source

pub const fn c_volume(self) -> u32

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> u32

The surface area of the 3d extent.

Source§

impl Extent3d<u64>

Source

pub const fn c_volume(self) -> u64

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> u64

The surface area of the 3d extent.

Source§

impl Extent3d<u128>

Source

pub const fn c_volume(self) -> u128

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> u128

The surface area of the 3d extent.

Source§

impl Extent3d<usize>

Source

pub const fn c_volume(self) -> usize

The volume of the 3d extent.

Source

pub const fn c_surface_area(self) -> usize

The surface area of the 3d extent.

Source§

impl Extent3d<f32>

Source

pub const fn volume(self) -> f32

The volume of the 3d extent.

Source

pub const fn surface_area(self) -> f32

The surface area of the 3d extent.

Source§

impl Extent3d<f64>

Source

pub const fn volume(self) -> f64

The volume of the 3d extent.

Source

pub const fn surface_area(self) -> f64

The surface area of the 3d extent.

Source§

impl<T, const D: usize> Extent<T, D>

Source

pub const fn new(dimensions: [T; D]) -> Self

Constructs a new Extent from the given dimensions.

Source

pub const fn as_slice(&self) -> &[T]

Returns a shared reference to the extent as a slice.

Source

pub fn as_slice_mut(&mut self) -> &mut [T]

Returns an exclusive reference to the extent as a slice.

Source

pub fn is_uniform_nd(&self) -> bool
where T: PartialEq,

Returns true if all dimensions of the extent are equal.

Source§

impl<T, const D: usize> Extent<T, D>

Source

pub fn as_intervals(self) -> [Interval<T>; D]
where T: Default,

TODO

Source

pub const fn as_intervals_const(self) -> [Interval<T>; D]
where T: Copy + ConstDefault,

TODO

Source

pub fn to_intervals(&self) -> [Interval<T>; D]
where T: Clone + Default,

Converts each dimension into an interval from zero to the dimension’s extent.

Source

pub fn fits_within(&self, interval: &Interval<T>) -> bool
where T: PartialOrd,

Checks if each dimension of the extent is within the given interval.

Source§

impl<const D: usize> Extent<f32, D>

Source

pub const fn measure(self) -> f32

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn boundary(self) -> f32

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<f64, D>

Source

pub const fn measure(self) -> f64

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn boundary(self) -> f64

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<i128, D>

Source

pub const fn c_measure(self) -> i128

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> i128

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<i16, D>

Source

pub const fn c_measure(self) -> i16

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> i16

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<i32, D>

Source

pub const fn c_measure(self) -> i32

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> i32

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<i64, D>

Source

pub const fn c_measure(self) -> i64

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> i64

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<i8, D>

Source

pub const fn c_measure(self) -> i8

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> i8

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<isize, D>

Source

pub const fn c_measure(self) -> isize

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> isize

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<u128, D>

Source

pub const fn c_measure(self) -> u128

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> u128

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<u16, D>

Source

pub const fn c_measure(self) -> u16

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> u16

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<u32, D>

Source

pub const fn c_measure(self) -> u32

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> u32

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<u64, D>

Source

pub const fn c_measure(self) -> u64

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> u64

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<u8, D>

Source

pub const fn c_measure(self) -> u8

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> u8

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Source§

impl<const D: usize> Extent<usize, D>

Source

pub const fn c_measure(self) -> usize

Returns the internal measure, the product of the extents.

It’s equivalent to length, area, and volume in 1, 2 and 3 dimensions.

Source

pub const fn c_boundary(self) -> usize

Returns the external boundary, the sum of the extents.

It’s equivalent to 2, perimeter and surface area in 1, 2 and 3 dimensions.

Trait Implementations

Source§

impl<T: Clone, const D: usize> Clone for Extent<T, D>

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: ConstDefault, const D: usize> ConstDefault for Extent<T, D>

Source§

const DEFAULT: Self

Returns the compile-time “default value” for a type.
Source§

impl<T: Debug, const D: usize> Debug for Extent<T, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default, const D: usize> Default for Extent<T, D>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: Display, const D: usize> Display for Extent<T, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Hash, const D: usize> Hash for Extent<T, D>

Source§

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

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, const D: usize> Ord for Extent<T, D>

Source§

fn cmp(&self, other: &Self) -> Ordering

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

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

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

impl<T: PartialEq, const D: usize> PartialEq for Extent<T, D>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PartialOrd, const D: usize> PartialOrd for Extent<T, D>

Source§

fn partial_cmp(&self, other: &Self) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: Copy, const D: usize> Copy for Extent<T, D>

Source§

impl<T: Eq, const D: usize> Eq for Extent<T, D>