Skip to main content

Half

Trait Half 

Source
pub trait Half: Sized {
    const HALF: Self;

    // Provided methods
    fn half() -> Self
       where Self: Sized { ... }
    fn set_half(&mut self) -> &mut Self { ... }
    fn is_half(self) -> bool
       where Self: PartialEq { ... }
    fn is_not_half(self) -> bool
       where Self: PartialEq { ... }
}
Expand description

Define the 0.5 representation

Required Associated Constants§

Source

const HALF: Self

Provided Methods§

Source

fn half() -> Self
where Self: Sized,

Source

fn set_half(&mut self) -> &mut Self

Source

fn is_half(self) -> bool
where Self: PartialEq,

Source

fn is_not_half(self) -> bool
where Self: PartialEq,

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Half for f32

Source§

const HALF: f32 = 0.5

Source§

impl Half for f64

Source§

const HALF: f64 = 0.5

Source§

impl<T, const N: usize> Half for [T; N]
where T: Half,

Source§

impl<T> Half for Saturating<T>
where T: Half,

Source§

impl<T> Half for Wrapping<T>
where T: Half,

Implementors§

Source§

impl<T, const N: usize> Half for SquareMatrix<T, N>
where T: Half + Zero + Copy,

Source§

const HALF: Self

Source§

impl<T, const N: usize> Half for Vector<T, N>
where T: Half + Copy,

Source§

const HALF: Self

Source§

impl<T> Half for RectangleOf<T>
where T: Half + Copy,

Source§

const HALF: Self