Ternary

Trait Ternary 

Source
pub trait Ternary {
    // Required methods
    fn or<O>(&self, t: O, f: O) -> O;
    fn or_else<O, F1: FnOnce() -> O, F2: FnOnce() -> O>(
        &self,
        t: F1,
        f: F2,
    ) -> O;
}

Required Methods§

Source

fn or<O>(&self, t: O, f: O) -> O

Source

fn or_else<O, F1: FnOnce() -> O, F2: FnOnce() -> O>(&self, t: F1, f: F2) -> O

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 Ternary for bool

Source§

fn or<O>(&self, t: O, f: O) -> O

Source§

fn or_else<O, F1: FnOnce() -> O, F2: FnOnce() -> O>(&self, t: F1, f: F2) -> O

Implementors§