pub trait Vec {
Show 18 methods
// Required methods
fn get_component_count(&self) -> usize;
fn get_component(&self, index: usize) -> f32;
fn set_component(&mut self, index: usize, value: f32);
// Provided methods
fn abs(&mut self) -> &mut Self { ... }
fn add(&mut self, other: &impl Vec) -> &mut Self { ... }
fn sub(&mut self, other: &impl Vec) -> &mut Self { ... }
fn mul(&mut self, other: &impl Vec) -> &mut Self { ... }
fn div(&mut self, other: &impl Vec) -> &mut Self { ... }
fn modulo(&mut self, other: &impl Vec) -> &mut Self { ... }
fn min(&mut self, other: &impl Vec) -> &mut Self { ... }
fn max(&mut self, other: &impl Vec) -> &mut Self { ... }
fn len(&self) -> f32 { ... }
fn neg(&mut self) -> &mut Self { ... }
fn scale(&mut self, f: f32) -> &mut Self { ... }
fn normal(&mut self) -> &mut Self { ... }
fn dist(&self, other: &impl Vec) -> f32 { ... }
fn dot(&self, other: &impl Vec) -> f32 { ... }
fn angle(&self, other: &impl Vec) -> f32 { ... }
}Required Methods§
fn get_component_count(&self) -> usize
fn get_component(&self, index: usize) -> f32
fn set_component(&mut self, index: usize, value: f32)
Provided Methods§
fn abs(&mut self) -> &mut Self
fn add(&mut self, other: &impl Vec) -> &mut Self
fn sub(&mut self, other: &impl Vec) -> &mut Self
fn mul(&mut self, other: &impl Vec) -> &mut Self
fn div(&mut self, other: &impl Vec) -> &mut Self
fn modulo(&mut self, other: &impl Vec) -> &mut Self
fn min(&mut self, other: &impl Vec) -> &mut Self
fn max(&mut self, other: &impl Vec) -> &mut Self
fn len(&self) -> f32
fn neg(&mut self) -> &mut Self
fn scale(&mut self, f: f32) -> &mut Self
fn normal(&mut self) -> &mut Self
fn dist(&self, other: &impl Vec) -> f32
fn dot(&self, other: &impl Vec) -> f32
fn angle(&self, other: &impl Vec) -> 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.