CTIf

Trait 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§

Source

type Result: CTBool

Type representing how the condition on the implemented type matches.

Source

type Path: 'static + ?Sized

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

Implementors§

Source§

impl<X, CondFail, OptionTrue, OptionFalse> CTIf<CondFail, OptionTrue, OptionFalse> for IfCheck<X>
where OptionTrue: 'static + ?Sized, OptionFalse: 'static + ?Sized,

Source§

type Result = CTFalse

Source§

type Path = OptionFalse

Source§

impl<X, OptionTrue, OptionFalse> CTIf<X, OptionTrue, OptionFalse> for IfCheck<X>
where OptionTrue: 'static + ?Sized, OptionFalse: 'static + ?Sized,

Source§

type Result = CTTrue

Source§

type Path = OptionTrue