1 unstable release
Uses old Rust 2015
0.0.1 | Jan 24, 2015 |
---|
#12 in #formally
4KB
The Finally trait provides a method, finally
on
stack closures that emulates Java-style try/finally blocks.
Using the finally
method is sometimes convenient, but the type rules
prohibit any shared, mutable state between the "try" case and the
"finally" case. For advanced cases, the try_finally
function can
also be used. See that function for more details.
Example
extern crate finally;
use finally::Finally;
(|&mut:| {
// ...
}).finally(|| {
// this code is always run
})