Skip to main content

if_then_else

Function if_then_else 

Source
pub fn if_then_else(
    cond: impl IntoExpr<PrimExpr>,
    true_value: impl IntoExpr<PrimExpr>,
    false_value: impl IntoExpr<PrimExpr>,
) -> Result<PrimExpr>
Expand description

Build true_value where cond holds and false_value elsewhere, evaluating only the chosen one.

ยงErrors

Returns an InternalError if cond is not a boolean or the values cannot be matched.