/// An error code value returned by most COM functions. #[repr(transparent)] #[derive(Copy, Clone, Default, Eq, PartialEq, Ord, PartialOrd, Hash)] #[must_use] #[allow(non_camel_case_types)] pubstruct HRESULT(pub i32);
impl HRESULT { /// Returns [`true`] if `self` is a success code. #[inline] pubconstfn is_ok(self) -> bool { self.0 >= 0
}
/// Returns [`true`] if `self` is a failure code. #[inline] pubconstfn is_err(self) -> bool {
!self.is_ok()
}
/// Asserts that `self` is a success code. /// /// This will invoke the [`panic!`] macro if `self` is a failure code and display /// the [`HRESULT`] value for diagnostics. #[inline] #[track_caller] pubfn unwrap(self) {
assert!(self.is_ok(), "HRESULT 0x{:X}", self.0);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.