Registry / utility / scopeguard

scopeguard

JSON →
library1.2.0rscratesunverified

A RAII scope guard that runs a given closure when it goes out of scope, even during unwinding panic.

# Cargo.toml [dependencies] scopeguard = "1.2.0"
INSTALL
IMPORT
SIG · SCOPEGUARD
S
scopeguard
utilityrustv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

guard
✓ use scopeguard::guard;

Creates a scope guard that executes a closure when the guard goes out of scope.

use scopeguard::guard; fn main() { let _guard = guard((), |_| println!("Cleanup on scope exit")); println!("Inside scope"); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.2.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
16
Resources
scopeguard — cargo add scopeguard · libregistry