capture_backtrace

Function capture_backtrace 

Source
pub fn capture_backtrace() -> Backtrace
Expand description

Captures a backtrace if the backtrace feature is enabled.

When the backtrace feature is enabled, this function captures a full backtrace using capture_backtrace(). When disabled (default), it returns a disabled backtrace with zero overhead.

§Performance

Backtrace capture is expensive (~1-10μs per capture). For performance-critical code, leave the backtrace feature disabled. Enable it during development or debugging to get detailed error traces.

§Example

# In Cargo.toml, enable backtraces for debugging:
[dependencies]
num-valid = { version = "0.2", features = ["backtrace"] }