Trait ct_utils::ct_if::CTIf

source ·
pub trait CTIf<Condition, OptionTrue, OptionFalse>where
    OptionTrue: 'static + ?Sized,
    OptionFalse: 'static + ?Sized,
{ type Result: CTBool; type Path: 'static + ?Sized; }
Expand description

Generic version of an IF test encoded within the type system.

Condition is the type which must match. OptionTrue will be passed into CTIf::Path if the condition match is TRUE. OptionFalse will be passed into CTIf::Path if the condition match is FALSE.

Specialized versions of this trait are necessary when the receiving type parameter is constrained. See ctif_specialize to create such a specialized version.

Required Associated Types§

Type representing how the condition on the implemented type matches.

Type which holds either of the two generic option arguments, depending on how the condition matches.

Implementors§