Trait ConstBool

Source
pub trait ConstBool: Default + Copy {
    type Conditional<T, F>;
    type ConditionalBool<T: ConstBool, F: ConstBool>: ConstBool;
    type ConditionalInt<T: ConstInteger, F: ConstInteger>: ConstInteger;
    type And<Other: ConstBool>: ConstBool;

    const VALUE: bool;

    // Required method
    fn conditional_exec<TrueFn, FalseFn>(
        t: TrueFn,
        f: FalseFn,
    ) -> Self::Conditional<TrueFn::Output, FalseFn::Output>
       where TrueFn: NullaryFunction,
             FalseFn: NullaryFunction;

    // Provided method
    fn value(self) -> bool { ... }
}

Required Associated Constants§

Required Associated Types§

Source

type Conditional<T, F>

T if true, F otherwise.

Source

type ConditionalBool<T: ConstBool, F: ConstBool>: ConstBool

Same as Self::Conditional but with ConstBool bounds.

Source

type ConditionalInt<T: ConstInteger, F: ConstInteger>: ConstInteger

Same as Self::Conditional but with ConstInteger bounds.

Source

type And<Other: ConstBool>: ConstBool

Required Methods§

Source

fn conditional_exec<TrueFn, FalseFn>( t: TrueFn, f: FalseFn, ) -> Self::Conditional<TrueFn::Output, FalseFn::Output>
where TrueFn: NullaryFunction, FalseFn: NullaryFunction,

Provided Methods§

Source

fn value(self) -> bool

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§