scope-exit 0.2.0

The util to call procedure when exit current scope. scope exit. like defer in go.
Documentation
  • Coverage
  • 0%
    0 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 3.06 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 994.66 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Shylock-Hg/scope-exit
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Shylock-Hg

Scope Exit utils

Will call closure when leave current scope. Useful to release some resource got from FFI.

e.g. Call c file API

fn test() {
    let fp = fopen("test.txt");
    scope_exit!(fclose(fp));
    // will call `fclose` by RAII
}