pub type HrResult<T> = Result<T, HRESULT>;
Available on crate feature
ole
only.Expand description
A Result
alias for COM error codes,
which returns an HRESULT
on failure.
§Examples
Converting into the generic AnyResult
:
use winsafe::{self as w, prelude::*, co};
let hr_result: w::HrResult<()> = Err(co::HRESULT::E_INVALIDARG);
let err_result: w::AnyResult<()> = hr_result.map_err(|err| err.into());
Converting from an SysResult
:
use winsafe::{self as w, prelude::*, co};
let win_result: w::SysResult<()> = Err(co::ERROR::FILE_NOT_FOUND);
let hr_result: w::HrResult<()> = win_result.map_err(|err| err.to_hresult());
Aliased Type§
enum HrResult<T> {
Ok(T),
Err(HRESULT),
}