scopeguard 0.3.0

A RAII scope guard that will run a given closure when it goes out of scope, even if the code between panics (assuming unwinding panic). Defines the macros `defer!` and `defer_on_unwind!`; the latter only runs if the scope is extited through unwinding on panic.
Documentation

A scope guard will run a given closure when it goes out of scope, even if the code between panics. (as long as panic doesn't abort)

Crate features:

  • use_std
    • Enabled by default. Enables the OnUnwind strategy.
    • Disable to use no_std.