rgo - Rust Scope Guard Implementation
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).
Installation
Add this to your Cargo.toml:
[]
= "0.2.0"
Usage
Basic Example
extern crate rgo;
defer! Macro
extern crate rgo;
use Cell;
Scope Guard with Value
extern crate rgo;
use File;
use ;
Crate Features
use_std(enabled by default): Enables theOnUnwindandOnSuccessstrategies- Disable
use_stdto useno_std
Rust Version
This crate requires Rust 1.20 or later.