[−][src]Crate 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.
Macros
bail | Return early with an error.
This macro is equivalent to |
ensure | Ensures the condition is met. This evaluates to a |
ensure_bail | Return early with an error if the condition is false. This ensures the condition is met.
This macro is equivalent to |
ensure_bail_not | Return early with an error if the condition is true. This ensures the condition is not met.
This macro is equivalent to |
ensure_not | Ensures the condition is not met. This evaluates to a |
ensure_not_or | Ensures the condition is not met or returns the value. This evaluates to a |
ensure_or | Ensures the condition is met or returns the value. This evaluates to a |