When writing code that uses Result
type, you may want different behavior for users and developers.
A result by itself doesn't have any backtrace information, but you can add it to custom error types.
The error_chain crate is an example which generates an error type for you, for which you get backtrace generation for free when the RUST_BACKTRACE
environment variable is set.
You could also use the backtrace library directly and do it yourself.