Trait Two

Source
pub trait Two: Sized {
    // Required method
    fn two() -> Self;

    // Provided methods
    fn is_two(&self) -> bool
       where Self: PartialEq<Self> { ... }
    fn is_non_two(&self) -> bool
       where Self: PartialEq<Self> { ... }
}
Expand description

Define the 2 representation for the number

Required Methods§

Source

fn two() -> Self

Provided Methods§

Source

fn is_two(&self) -> bool
where Self: PartialEq<Self>,

Source

fn is_non_two(&self) -> bool
where Self: PartialEq<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.

Implementors§

Source§

impl<T> Two for T
where T: One + Add<T, Output = T>,