Trait Vector

Source
pub trait Vector: Clone {
    type Scalar: Copy;

    // Required methods
    fn length_squared(&self) -> Self::Scalar;
    fn scale(&mut self, factor: Self::Scalar);
    fn sub(&self, other: &Self) -> Self;
    fn add_scaled(&mut self, factor: Self::Scalar, other: &Self);
    fn reset(&mut self);
    fn clip_within(&mut self, min: &Self, max: &Self);
    fn new() -> Self;
}

Required Associated Types§

Required Methods§

Source

fn length_squared(&self) -> Self::Scalar

Source

fn scale(&mut self, factor: Self::Scalar)

Source

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

Source

fn add_scaled(&mut self, factor: Self::Scalar, other: &Self)

Source

fn reset(&mut self)

Source

fn clip_within(&mut self, min: &Self, max: &Self)

Source

fn new() -> 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§