Expand description
Error structure containing the available information on a COM error.
Fields
hresult: HRESULT
HRESULT
that triggered the error.
error_info: Option<ErrorInfo>
Possible detailed error info.
Implementations
sourceimpl ComError
impl ComError
sourcepub fn new_message(hresult: HRESULT, description: String) -> ComError
pub fn new_message(hresult: HRESULT, description: String) -> ComError
Construts a new ComError
with a given message.
pub fn with_message<S: Into<String>>(self, msg: S) -> Self
sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Gets the description if it’s available.
pub const E_NOTIMPL: ComError = ComError { hresult: raw::E_NOTIMPL, error_info: None, }
pub const E_NOINTERFACE: ComError = ComError { hresult: raw::E_NOINTERFACE, error_info: None, }
pub const E_POINTER: ComError = ComError { hresult: raw::E_POINTER, error_info: None, }
pub const E_ABORT: ComError = ComError { hresult: raw::E_ABORT, error_info: None, }
pub const E_FAIL: ComError = ComError { hresult: raw::E_FAIL, error_info: None, }
pub const E_INVALIDARG: ComError = ComError { hresult: raw::E_INVALIDARG, error_info: None, }
pub const E_ACCESSDENIED: ComError = ComError { hresult: raw::E_ACCESSDENIED, error_info: None, }
pub const STG_E_FILENOTFOUND: ComError = ComError { hresult: raw::STG_E_FILENOTFOUND, error_info: None, }
pub const RPC_E_DISCONNECTED: ComError = ComError { hresult: raw::RPC_E_DISCONNECTED, error_info: None, }
pub const RPC_E_CALL_REJECTED: ComError = ComError { hresult: raw::RPC_E_CALL_REJECTED, error_info: None, }
pub const RPC_E_CALL_CANCELED: ComError = ComError { hresult: raw::RPC_E_CALL_CANCELED, error_info: None, }
pub const RPC_E_TIMEOUT: ComError = ComError { hresult: raw::RPC_E_TIMEOUT, error_info: None, }
Trait Implementations
sourceimpl Error for ComError
impl Error for ComError
sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourcefn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
replaced by Error::source, which can support downcasting
sourceimpl<TS: TypeSystem> ExternOutput<TS> for ComError
impl<TS: TypeSystem> ExternOutput<TS> for ComError
fn into_foreign_output(self) -> ComResult<Self::ForeignType>
sourceunsafe fn from_foreign_output(source: Self::ForeignType) -> ComResult<Self>
unsafe fn from_foreign_output(source: Self::ForeignType) -> ComResult<Self>
Safety Read more
sourceunsafe fn drop_foreign_output(source: Self::ForeignType)
unsafe fn drop_foreign_output(source: Self::ForeignType)
Safety Read more
sourceimpl<TS: TypeSystem> ExternType<TS> for ComError
impl<TS: TypeSystem> ExternType<TS> for ComError
type ForeignType = HRESULT
sourceimpl From<ComError> for TypeLibError
impl From<ComError> for TypeLibError
sourceimpl From<VariantError> for ComError
impl From<VariantError> for ComError
sourcefn from(_: VariantError) -> Self
fn from(_: VariantError) -> Self
Converts to this type from the input type.
sourceimpl From<VariantError> for ComError
impl From<VariantError> for ComError
sourcefn from(_: VariantError) -> Self
fn from(_: VariantError) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for ComError
impl Send for ComError
impl Sync for ComError
impl Unpin for ComError
impl UnwindSafe for ComError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ErrorValue for T where
T: From<ComError>,
impl<T> ErrorValue for T where
T: From<ComError>,
sourcefn from_error(err: ComError) -> T
fn from_error(err: ComError) -> T
Attempts to convert a COM error into a custom status code. Must not panic.
sourceimpl<T> ExternDefault for T
impl<T> ExternDefault for T
sourceunsafe fn extern_default() -> T
unsafe fn extern_default() -> T
Safety Read more
sourceimpl<E> Fail for E where
E: 'static + Error + Send + Sync,
impl<E> Fail for E where
E: 'static + Error + Send + Sync,
sourcefn cause(&self) -> Option<&(dyn Fail + 'static)>
fn cause(&self) -> Option<&(dyn Fail + 'static)>
Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Returns a reference to the Backtrace
carried by this failure, if it
carries one. Read more