Skip to main content

HaveYAndOne

Trait HaveYAndOne 

Source
pub trait HaveYAndOne<T>: HaveY<T> {
    const Y: Self;
    const UP: Self = Self::Y;

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

Required Associated Constants§

Source

const Y: Self

Provided Associated Constants§

Source

const UP: Self = Self::Y

+ Y

Provided Methods§

Source

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

+ Y

Source

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

- Y

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.

Implementors§

Source§

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

Source§

const Y: Self

Source§

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

Source§

const Y: Self

Source§

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

Source§

const Y: Self