pyo3_macros_backend::utils

Macro ensure_spanned

Source
macro_rules! ensure_spanned {
    ($condition:expr, $span:expr => $msg:expr) => { ... };
    ($($condition:expr, $span:expr => $msg:expr;)*) => { ... };
}
Expand description

Macro inspired by anyhow::ensure! to return a compiler error with the given span if the specified condition is not met.

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here