Trait truck_rendimpl::modeling::base::Array [−]
An array containing elements of type Element
Associated Types
Loading content...Required methods
pub fn len() -> usize
Get the number of elements in the array type
use cgmath::prelude::*; use cgmath::Vector3; assert_eq!(Vector3::<f32>::len(), 3);
pub fn from_value(value: Self::Element) -> Self
Construct a vector from a single value, replicating it.
use cgmath::prelude::*; use cgmath::Vector3; assert_eq!(Vector3::from_value(1), Vector3::new(1, 1, 1));
pub fn sum(self) -> Self::Element where
Self::Element: Add<Self::Element>,
<Self::Element as Add<Self::Element>>::Output == Self::Element,
Self::Element: Add<Self::Element>,
<Self::Element as Add<Self::Element>>::Output == Self::Element,
The sum of the elements of the array.
pub fn product(self) -> Self::Element where
Self::Element: Mul<Self::Element>,
<Self::Element as Mul<Self::Element>>::Output == Self::Element,
Self::Element: Mul<Self::Element>,
<Self::Element as Mul<Self::Element>>::Output == Self::Element,
The product of the elements of the array.
pub fn is_finite(&self) -> bool where
Self::Element: BaseFloat,
Self::Element: BaseFloat,
Whether all elements of the array are finite
Provided methods
pub fn as_ptr(&self) -> *const Self::Element
Get the pointer to the first element of the array.
pub fn as_mut_ptr(&mut self) -> *mut Self::Element
Get a mutable pointer to the first element of the array.
pub fn swap_elements(&mut self, i: usize, j: usize)
Swap the elements at indices i
and j
in-place.
Implementations on Foreign Types
impl<S> Array for Vector1<S> where
S: Copy,
S: Copy,
type Element = S
pub fn len() -> usize
pub fn from_value(scalar: S) -> Vector1<S>
pub fn sum(self) -> S where
S: Add<S, Output = S>,
S: Add<S, Output = S>,
pub fn product(self) -> S where
S: Mul<S, Output = S>,
S: Mul<S, Output = S>,
pub fn is_finite(&self) -> bool where
S: BaseFloat,
S: BaseFloat,
impl<S> Array for Point2<S> where
S: BaseNum,
S: BaseNum,
type Element = S
pub fn len() -> usize
pub fn from_value(scalar: S) -> Point2<S>
pub fn sum(self) -> S where
S: Add<S, Output = S>,
S: Add<S, Output = S>,
pub fn product(self) -> S where
S: Mul<S, Output = S>,
S: Mul<S, Output = S>,
pub fn is_finite(&self) -> bool where
S: BaseFloat,
S: BaseFloat,
impl<S> Array for Vector2<S> where
S: Copy,
S: Copy,
type Element = S
pub fn len() -> usize
pub fn from_value(scalar: S) -> Vector2<S>
pub fn sum(self) -> S where
S: Add<S, Output = S>,
S: Add<S, Output = S>,
pub fn product(self) -> S where
S: Mul<S, Output = S>,
S: Mul<S, Output = S>,
pub fn is_finite(&self) -> bool where
S: BaseFloat,
S: BaseFloat,
impl<S> Array for Vector4<S> where
S: Copy,
S: Copy,
type Element = S
pub fn len() -> usize
pub fn from_value(scalar: S) -> Vector4<S>
pub fn sum(self) -> S where
S: Add<S, Output = S>,
S: Add<S, Output = S>,
pub fn product(self) -> S where
S: Mul<S, Output = S>,
S: Mul<S, Output = S>,
pub fn is_finite(&self) -> bool where
S: BaseFloat,
S: BaseFloat,
impl<S> Array for Point3<S> where
S: BaseNum,
S: BaseNum,
type Element = S
pub fn len() -> usize
pub fn from_value(scalar: S) -> Point3<S>
pub fn sum(self) -> S where
S: Add<S, Output = S>,
S: Add<S, Output = S>,
pub fn product(self) -> S where
S: Mul<S, Output = S>,
S: Mul<S, Output = S>,
pub fn is_finite(&self) -> bool where
S: BaseFloat,
S: BaseFloat,
impl<S> Array for Vector3<S> where
S: Copy,
S: Copy,
type Element = S
pub fn len() -> usize
pub fn from_value(scalar: S) -> Vector3<S>
pub fn sum(self) -> S where
S: Add<S, Output = S>,
S: Add<S, Output = S>,
pub fn product(self) -> S where
S: Mul<S, Output = S>,
S: Mul<S, Output = S>,
pub fn is_finite(&self) -> bool where
S: BaseFloat,
S: BaseFloat,
impl<S> Array for Point1<S> where
S: BaseNum,
S: BaseNum,
type Element = S
pub fn len() -> usize
pub fn from_value(scalar: S) -> Point1<S>
pub fn sum(self) -> S where
S: Add<S, Output = S>,
S: Add<S, Output = S>,
pub fn product(self) -> S where
S: Mul<S, Output = S>,
S: Mul<S, Output = S>,
pub fn is_finite(&self) -> bool where
S: BaseFloat,
S: BaseFloat,