Skip to main content

HaveXAndOne

Trait HaveXAndOne 

Source
pub trait HaveXAndOne<T>: HaveX<T> {
    const X: Self;
    const RIGHT: Self = Self::X;

    // Provided methods
    fn right(self) -> Self
       where Self: Add<Self, Output = Self> { ... }
    fn left(self) -> Self
       where Self: Sub<Self, Output = Self> { ... }
}

Required Associated Constants§

Source

const X: Self

Provided Associated Constants§

Source

const RIGHT: Self = Self::X

+ X

Provided Methods§

Source

fn right(self) -> Self
where Self: Add<Self, Output = Self>,

+ X

Source

fn left(self) -> Self
where Self: Sub<Self, Output = Self>,

- X

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> HaveXAndOne<T> for Vector1<T>
where T: One + Zero,

Source§

const X: Self

Source§

impl<T> HaveXAndOne<T> for Vector2<T>
where T: One + Zero,

Source§

const X: Self

Source§

impl<T> HaveXAndOne<T> for Vector3<T>
where T: One + Zero,

Source§

const X: Self

Source§

impl<T> HaveXAndOne<T> for Vector4<T>
where T: One + Zero,

Source§

const X: Self