pub struct HResult(pub RawHResult);Expand description
A failed (or, rarely, non-S_OK success) HRESULT; the error type of
every generated method whose IDL signature returns HRESULT.
Tuple Fields§
§0: RawHResultImplementations§
Source§impl HResult
impl HResult
pub const NOTIMPL: HResult
pub const NOINTERFACE: HResult
pub const POINTER: HResult
pub const ABORT: HResult
pub const FAIL: HResult
pub const UNEXPECTED: HResult
pub const HANDLE: HResult
pub const INVALIDARG: HResult
pub const INVALIDOPERATION: HResult
pub const OBJECTDISPOSED: HResult
Sourcepub fn check(raw: RawHResult) -> Result<(), HResult>
pub fn check(raw: RawHResult) -> Result<(), HResult>
Maps a raw HRESULT to Ok(()) for S_OK and Err for anything
else. This mirrors the native sources and MicroCom’s C# proxies, which
test hr != S_OK rather than the sign bit.
Sourcepub fn from_result(r: Result<(), HResult>) -> RawHResult
pub fn from_result(r: Result<(), HResult>) -> RawHResult
Converts a callback result back to the raw value handed to native code.
pub fn name(self) -> Option<&'static str>
Trait Implementations§
impl Copy for HResult
impl Eq for HResult
Source§impl Error for HResult
impl Error for HResult
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for HResult
Auto Trait Implementations§
impl Freeze for HResult
impl RefUnwindSafe for HResult
impl Send for HResult
impl Sync for HResult
impl Unpin for HResult
impl UnsafeUnpin for HResult
impl UnwindSafe for HResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more