bail-out 0.2.0

Macros to help keep code clean for validations and error handling
Documentation
  • Coverage
  • 100%
    8 out of 8 items documented7 out of 7 items with examples
  • Size
  • Source code size: 8.55 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.25 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • augustocdias/bail-out
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • augustocdias

Bail Out

This library is inspired in the ensure and bail macros from anyhow. The difference is that it is not tied to anyhow's types.

Many libraries have their own error types and using the anyhow's ensure macro doesn't work because it returns an anyhow error. This library intends to work with any type.

This library also provides the assure macro, that does the same but evaluates to a Result instead of returning. This is useful for using inside try blocks.

Please check the docs for usage.