We should surface the ComError better in Rust. This means making it available as the Err-value in ComResult.
Though for performance reasons we will need to either...
Make retrieving the error details (message, etc.) retrieve the IErrorInfo on demand, or...
Add ComHResult<..> type that contains only the HRESULT.
The former would result in simpler intercom type system. However if the on-demand stuff happens much later the error message might have been overwritten already. The latter would allow us to resolve the ComError for ComResults immediately and also allow ComError to be send/sync given it would be immutable. (On-demand resolution would prevent send since the error message needs to be resolved in the thread where it happened).
We should surface the ComError better in Rust. This means making it available as the Err-value in ComResult.
Though for performance reasons we will need to either...
The former would result in simpler intercom type system. However if the on-demand stuff happens much later the error message might have been overwritten already. The latter would allow us to resolve the ComError for ComResults immediately and also allow ComError to be send/sync given it would be immutable. (On-demand resolution would prevent send since the error message needs to be resolved in the thread where it happened).