Trait One

Source
pub trait One {
    const ONE: Self;

    // Required method
    fn is_one(&self) -> bool;
}

Required Associated Constants§

Source

const ONE: Self

The one value for this type.

Required Methods§

Source

fn is_one(&self) -> bool

Whether the value is one.

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.

Implementations on Foreign Types§

Source§

impl One for f32

Source§

const ONE: Self = 1f32

Source§

fn is_one(&self) -> bool

Source§

impl One for f64

Source§

const ONE: Self = 1f64

Source§

fn is_one(&self) -> bool

Source§

impl One for u8

Source§

const ONE: Self = 1u8

Source§

fn is_one(&self) -> bool

Source§

impl One for u16

Source§

const ONE: Self = 1u16

Source§

fn is_one(&self) -> bool

Source§

impl One for u32

Source§

const ONE: Self = 1u32

Source§

fn is_one(&self) -> bool

Source§

impl One for u64

Source§

const ONE: Self = 1u64

Source§

fn is_one(&self) -> bool

Source§

impl One for u128

Source§

const ONE: Self = 1u128

Source§

fn is_one(&self) -> bool

Source§

impl One for usize

Source§

const ONE: Self = 1usize

Source§

fn is_one(&self) -> bool

Implementors§