Skip to main content

Bases

Trait Bases 

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

Source

fn unit_bases<const I: usize>() -> Self
where Self: Basis<I>,

Creates the specified unit basis of the vector space.

Source

fn bases_of<const I: usize>(magnitude: Self::Scalar) -> Self
where Self: Basis<I>,

Creates the specified basis of the vector of the specified magnitude.

Source

fn bases<const I: usize>(&self) -> Self::Scalar
where Self: Basis<I>,

Queries the specified basis of a vector space.

Source

fn bases_mut<const I: usize>(&mut self) -> &mut Self::Scalar
where Self: Basis<I>,

Queries the specified basis of a vector space as a mutable reference.

Source

fn with_bases<const I: usize>(self, magnitude: Self::Scalar) -> Self
where 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".

Implementors§

Source§

impl<T: VectorSpace> Bases for T