IfCheck

Struct IfCheck 

Source
pub struct IfCheck<X> { /* private fields */ }
Expand description

Actual type used to perform an IF check through the type system.

Performing an IF test through the type system requires both this structure as well as the CTIf trait (or a specialized one). The typed that needs to be matched is passed into this struct as generic argument for X. The resulting type must then be cast as CTIf trait, which includes the desired type. CTIf::Path will then hold the match relevant type. eg

<IfCheck<Subject> as CTIf<Desired, TypeTrue, TypeFalse>>::Path;

Trait Implementations§

Source§

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

Source§

type Result = CTFalse

Type representing how the condition on the implemented type matches.
Source§

type Path = OptionFalse

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

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

Source§

type Result = CTTrue

Type representing how the condition on the implemented type matches.
Source§

type Path = OptionTrue

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

impl<X, CondFail, OptionTrue, OptionFalse> CTIfOffset<CondFail, OptionTrue, OptionFalse> for IfCheck<X>
where OptionTrue: Unsigned + Add<U1>, OptionFalse: Unsigned + Add<U1>,

Source§

type Result = CTFalse

Auto generated
Source§

type Path = OptionFalse

Auto generated
Source§

impl<X, OptionTrue, OptionFalse> CTIfOffset<X, OptionTrue, OptionFalse> for IfCheck<X>
where OptionTrue: Unsigned + Add<U1>, OptionFalse: Unsigned + Add<U1>,

Source§

type Result = CTTrue

Auto generated
Source§

type Path = OptionTrue

Auto generated

Auto Trait Implementations§

§

impl<X> Freeze for IfCheck<X>

§

impl<X> RefUnwindSafe for IfCheck<X>
where X: RefUnwindSafe,

§

impl<X> Send for IfCheck<X>
where X: Send,

§

impl<X> Sync for IfCheck<X>
where X: Sync,

§

impl<X> Unpin for IfCheck<X>
where X: Unpin,

§

impl<X> UnwindSafe for IfCheck<X>
where X: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.