Trait One

Source
pub trait One: Sized {
    // Required methods
    fn one() -> Self;
    fn is_one(&self) -> bool;

    // Provided method
    fn set_one(&mut self) { ... }
}

Required Methods§

Source

fn one() -> Self

Source

fn is_one(&self) -> bool

Provided Methods§

Source

fn set_one(&mut self)

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 f64

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for i8

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for i16

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for i32

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for i64

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for i128

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for u8

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for u16

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for u32

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for u64

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for u128

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for usize

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for BigInt

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for BigUint

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl One for BigFraction

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Implementors§