> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Struct IfExpression

Module: `std::meta::expr`

```rust
pub comptime struct IfExpression
{ /* private fields */ }
```

An if expression decomposed by [`Expr::as_if`](/aztec-nr-api/v6.0.0/std/primitive.Expr.md#as_if).

## Implementations

```rust
impl IfExpression
```

```rust
pub comptime fn condition(self) -> Expr
```

The condition controlling the expression.

```rust
pub comptime fn consequence(self) -> Expr
```

The branch evaluated when the condition is true.

```rust
pub comptime fn alternative(self) -> Option<Expr>
```

The optional branch evaluated when the condition is false.
