pub struct Error { /* private fields */ }Expand description
Make passing error code to SF api easier. Provides conversion from windows errors or fabric error code to windows_core::Error. All safe code uses this Error, and bridge and proxy code needs to convert this Error into/from WinError.
Implementations§
Source§impl Error
impl Error
pub fn new(code: HRESULT, msg: Option<WString>) -> Self
Sourcepub fn from_hresult(code: HRESULT) -> Self
pub fn from_hresult(code: HRESULT) -> Self
Create error from HRESULT code only, with no message.
Sourcepub fn try_as_fabric_error_code(&self) -> Result<ErrorCode, &str>
pub fn try_as_fabric_error_code(&self) -> Result<ErrorCode, &str>
Convert to fabric error code if possible.
Sourcepub fn from_thread(code: HRESULT) -> Self
pub fn from_thread(code: HRESULT) -> Self
Create error from current thread last error code and message.
pub fn code(&self) -> HRESULT
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<FABRIC_ERROR_CODE> for Error
impl From<FABRIC_ERROR_CODE> for Error
Source§fn from(value: FABRIC_ERROR_CODE) -> Self
fn from(value: FABRIC_ERROR_CODE) -> Self
Converts to this type from the input type.
Source§impl From<TryFromIntError> for Error
impl From<TryFromIntError> for Error
Source§fn from(value: TryFromIntError) -> Self
fn from(value: TryFromIntError) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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