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§
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
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.