Skip to main content

Three

Trait Three 

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

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

Define the 3 representation for the number

Required Methods§

Source

fn three() -> Self

There will be a constant THREE later when const trait will be stable

Provided Methods§

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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