pub trait Vector<C>:
Copy
+ Debug
+ Default
+ FromIterator<C>
+ Send
+ Syncwhere
C: Component,{
const AXES: usize;
// Required methods
fn get(self, index: usize) -> Option<C>;
fn dot(self, rhs: Self) -> C;
// Provided methods
fn from_slice(slice: &[C]) -> Self { ... }
fn iter(&self) -> Iter<'_, Self, C> ⓘ { ... }
fn distance(self, rhs: Self) -> f32
where C: Into<f32> { ... }
fn magnitude(self) -> f32
where C: Into<f32> { ... }
}
Available on crate feature
vector
only.Expand description
Algebraic vector generic over a given Component
type.
Required Associated Constants§
Required Methods§
Provided Methods§
Sourcefn from_slice(slice: &[C]) -> Self
fn from_slice(slice: &[C]) -> Self
Instantiate a vector from a slice of components.
Panics if the slice is not the right size.
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.