Skip to main content

Constant

Trait Constant 

Source
pub trait Constant<T> {
    const CONSTANT: T;
}
Expand description

Constant Policy Value

Required Associated Constants§

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> Constant<T> for ConstantHalf<T>
where T: Half,

Source§

const CONSTANT: T = T::HALF

Source§

impl<T> Constant<T> for ConstantInfinity<T>
where T: Infinity,

Source§

const CONSTANT: T = T::INFINITY

Source§

impl<T> Constant<T> for ConstantMax<T>
where T: MaxValue,

Source§

const CONSTANT: T = T::MAX

Source§

impl<T> Constant<T> for ConstantMin<T>
where T: MinValue,

Source§

const CONSTANT: T = T::MIN

Source§

impl<T> Constant<T> for ConstantMinusInfinity<T>
where T: MinusInfinity,

Source§

const CONSTANT: T = T::MINUS_INFINITY

Source§

impl<T> Constant<T> for ConstantMinusOne<T>
where T: MinusOne,

Source§

const CONSTANT: T = T::MINUS_ONE

Source§

impl<T> Constant<T> for ConstantNaN<T>
where T: NaNValue,

Source§

const CONSTANT: T = T::NAN

Source§

impl<T> Constant<T> for ConstantOne<T>
where T: One,

Source§

const CONSTANT: T = T::ONE

Source§

impl<T> Constant<T> for ConstantZero<T>
where T: Zero,

Source§

const CONSTANT: T = T::ZERO