scopeguard 0.3.1

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.

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.