Skip to main content

Vector

Trait Vector 

Source
pub trait Vector<T, const N: usize>:
    Copy
    + Clone
    + Send
    + Sync
    + 'static
    + Default
    + PartialEq
    + Debug
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Rem<Output = Self>
    + Neg<Output = Self>
where T: Scalar,
{
Show 15 methods // Required methods fn splat(value: T) -> Self; fn load(slice: &[T]) -> Self; fn store(&self, slice: &mut [T]); fn extract(&self, index: usize) -> T; fn insert(&self, index: usize, value: T) -> Self; fn add(&self, other: &Self) -> Self; fn sub(&self, other: &Self) -> Self; fn mul(&self, other: &Self) -> Self; fn div(&self, other: &Self) -> Self; fn rem(&self, other: &Self) -> Self; fn neg(&self) -> Self; fn abs(&self) -> Self; fn min(&self, other: &Self) -> Self; fn max(&self, other: &Self) -> Self; fn clamp(&self, min: &Self, max: &Self) -> Self;
}
Expand description

Основной трейт для векторных типов (базовые операции).

Параметризован типом элемента T: Scalar и шириной N.

Required Methods§

Source

fn splat(value: T) -> Self

Source

fn load(slice: &[T]) -> Self

Source

fn store(&self, slice: &mut [T])

Source

fn extract(&self, index: usize) -> T

Source

fn insert(&self, index: usize, value: T) -> Self

Source

fn add(&self, other: &Self) -> Self

Source

fn sub(&self, other: &Self) -> Self

Source

fn mul(&self, other: &Self) -> Self

Source

fn div(&self, other: &Self) -> Self

Source

fn rem(&self, other: &Self) -> Self

Source

fn neg(&self) -> Self

Source

fn abs(&self) -> Self

Source

fn min(&self, other: &Self) -> Self

Source

fn max(&self, other: &Self) -> Self

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Vector<f32, 4> for F32x4

Source§

impl<T> Vector<T, 1> for ScalarVector1<T>
where T: Scalar,

Source§

impl<T> Vector<T, 2> for ScalarVector2<T>
where T: Scalar,

Source§

impl<T> Vector<T, 4> for ScalarVector4<T>
where T: Scalar,