pub trait Bases: VectorSpace {
// Provided methods
fn unit_bases<const I: usize>() -> Self
where Self: Basis<I> { ... }
fn bases_of<const I: usize>(magnitude: Self::Scalar) -> Self
where Self: Basis<I> { ... }
fn bases<const I: usize>(&self) -> Self::Scalar
where Self: Basis<I> { ... }
fn bases_mut<const I: usize>(&mut self) -> &mut Self::Scalar
where Self: Basis<I> { ... }
fn with_bases<const I: usize>(self, magnitude: Self::Scalar) -> Self
where Self: Basis<I> { ... }
}Expand description
This trait makes it easy to deal with specified bases of a vector in a generic way.
Provided Methods§
Sourcefn unit_bases<const I: usize>() -> Selfwhere
Self: Basis<I>,
fn unit_bases<const I: usize>() -> Selfwhere
Self: Basis<I>,
Creates the specified unit basis of the vector space.
Sourcefn bases_of<const I: usize>(magnitude: Self::Scalar) -> Selfwhere
Self: Basis<I>,
fn bases_of<const I: usize>(magnitude: Self::Scalar) -> Selfwhere
Self: Basis<I>,
Creates the specified basis of the vector of the specified magnitude.
Sourcefn bases<const I: usize>(&self) -> Self::Scalarwhere
Self: Basis<I>,
fn bases<const I: usize>(&self) -> Self::Scalarwhere
Self: Basis<I>,
Queries the specified basis of a vector space.
Sourcefn bases_mut<const I: usize>(&mut self) -> &mut Self::Scalarwhere
Self: Basis<I>,
fn bases_mut<const I: usize>(&mut self) -> &mut Self::Scalarwhere
Self: Basis<I>,
Queries the specified basis of a vector space as a mutable reference.
Sourcefn with_bases<const I: usize>(self, magnitude: Self::Scalar) -> Selfwhere
Self: Basis<I>,
fn with_bases<const I: usize>(self, magnitude: Self::Scalar) -> Selfwhere
Self: Basis<I>,
Creates a new vector with the specified basis set to a different value.
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.