pub trait Vector<const N: usize>:
Sized
+ Copy
+ Clone {
Show 22 methods
// Required methods
fn get(&self, i: usize) -> f32;
fn set(&mut self, i: usize, v: f32);
fn add_self(&self, other: &Self) -> Self;
fn sub_self(&self, other: &Self) -> Self;
fn div_self(&self, other: &Self) -> Self;
fn mul_self(&self, other: &Self) -> Self;
fn scale(&self, s: f32) -> Self;
fn less_than(&self, other: &Self) -> bool;
fn greater_than(&self, other: &Self) -> bool;
fn cmin(&self, other: Self) -> Self;
fn cmax(&self, other: Self) -> Self;
fn mid_point(&self, other: Self) -> Self;
fn dot_self(&self, other: &Self) -> f32;
fn cprod(&self) -> f32;
fn cmap<F: Fn(f32) -> f32>(&self, f: F) -> Self;
fn cmap_mut<F: FnMut(f32) -> f32>(&self, f: F) -> Self;
fn min_elem(&self) -> f32;
fn max_elem(&self) -> f32;
fn to_arr(&self) -> [f32; N];
fn from_arr(a: [f32; N]) -> Self;
fn normalized(&self) -> Self;
fn mag(&self) -> f32;
}Required Methods§
fn get(&self, i: usize) -> f32
fn set(&mut self, i: usize, v: f32)
fn add_self(&self, other: &Self) -> Self
fn sub_self(&self, other: &Self) -> Self
fn div_self(&self, other: &Self) -> Self
fn mul_self(&self, other: &Self) -> Self
fn scale(&self, s: f32) -> Self
fn less_than(&self, other: &Self) -> bool
fn greater_than(&self, other: &Self) -> bool
fn cmin(&self, other: Self) -> Self
fn cmax(&self, other: Self) -> Self
fn mid_point(&self, other: Self) -> Self
fn dot_self(&self, other: &Self) -> f32
fn cprod(&self) -> f32
fn cmap<F: Fn(f32) -> f32>(&self, f: F) -> Self
fn cmap_mut<F: FnMut(f32) -> f32>(&self, f: F) -> Self
fn min_elem(&self) -> f32
fn max_elem(&self) -> f32
fn to_arr(&self) -> [f32; N]
fn from_arr(a: [f32; N]) -> Self
fn normalized(&self) -> Self
fn mag(&self) -> f32
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.