I'm using ldap3 crate and I have an issue when searching: if the search fails to find anything, the crate wraps the status object in io::Error. I've seen get_ref() in io:Error but I can't test any field of the ref as it's a &(dyn Error + Send + Sync + 'static) and not an LdapResult.
There is also into_inner and source methods on io::Error and std::error::Error. However they will just produce a trait object, similar to get_ref.
If you know or suspect what type the error is, you have to downcast it to the inner error to get any useful information out of it other than the Display impl.