unfortunately, in rust, an error trace is not enforced, it's up to the library author to implement the functionality.
if the error you got implemented the std::error::Error trait, you can try walk the source() chain. again, it's not guaranteed to be available, it's a matter of quality of implementation for the specific library.
you don't have to write the code yourself, you can use any error reporting library, such as anyhow, just convert the error into anyhow::Error and you can print it using the Debug format, something like this:
let e = some_library_api().unwrap_err();
let e = anyhow::Error::new(e);
println!("{:?}", e);
if the error type is well designed, this should print out the full error trace.
note, if the original error didn't capture a stack trace, anyhow will add one, but it is not useful.
yes, it's possible, but you might need set multiple breakpoints since it has several constructors, and you don't know which one is actually called.
for errors carrying an OS specific error code, it is most likely to be constructed using Error::last_os_error() or Error::from_raw_os_error(). so try these first. if they didn't work, the std::io::Error is probably used as a wrapper for other error types, in which case try Error::new() and Error::other(). another potential constructor is the From<ErrorKind> impl block, so try that one if the others don't work.
there are other From conversions, but they are unlikely to be used by a third party library.