Skip to main content

One

Trait One 

Source
pub trait One {
    const ONE: Self;
}
Expand description

A trait for numeric types which have a one. This trait is implemented on all primitive numeric types.

Required Associated Constants§

Source

const ONE: Self

The instance of this type representing one.

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 One for f32

Source§

const ONE: f32 = 1.0

Source§

impl One for f64

Source§

const ONE: f64 = 1.0

Source§

impl One for i8

Source§

const ONE: i8 = 1

Source§

impl One for i16

Source§

const ONE: i16 = 1

Source§

impl One for i32

Source§

const ONE: i32 = 1

Source§

impl One for i64

Source§

const ONE: i64 = 1

Source§

impl One for i128

Source§

const ONE: i128 = 1

Source§

impl One for isize

Source§

const ONE: isize = 1

Source§

impl One for u8

Source§

const ONE: u8 = 1

Source§

impl One for u16

Source§

const ONE: u16 = 1

Source§

impl One for u32

Source§

const ONE: u32 = 1

Source§

impl One for u64

Source§

const ONE: u64 = 1

Source§

impl One for u128

Source§

const ONE: u128 = 1

Source§

impl One for usize

Source§

const ONE: usize = 1

Implementors§