Skip to main content

boundary_check

Attribute Macro boundary_check 

Source
#[boundary_check]
Expand description

Enforce boundary handling at compile time.

Within a #[boundary_check] function:

  • .unwrap() is a compile error — handle the boundary explicitly
  • Wildcard Boundary { .. } match arms are a compile error — each boundary kind deserves its own handler
#[boundary_check]
fn safe_pipeline(x: f64) -> Value<f64, DivisionByZero> {
    let a = divide(10.0, x);
    // a.unwrap()  — compile error!
    a.or(0.0)      // explicit fallback — allowed
}