[][src]Trait trait_eval::If

pub trait If<T: Bool> {
    type Result;
}

Conditional execution!

The syntax is kind of clunky, but write <(Then, Else) as If<Cond>::Result. The condition can be any boolean expression built using True, False, AndAlso, OrElse and Not. Talk about feature complete.

assert_eq!(<(Three, Four) as If<True>>::Result::eval(), 3);
assert_eq!(<(Three, Four) as If<False>>::Result::eval(), 4);

Associated Types

type Result

Loading content...

Implementations on Foreign Types

impl<U, V> If<True> for (U, V)[src]

type Result = U

impl<U, V> If<False> for (U, V)[src]

type Result = V

Loading content...

Implementors

Loading content...