Struct windows::ErrorCode[][src]

#[repr(transparent)]
#[must_use]pub struct ErrorCode(pub u32);

A primitive error code value returned by most COM functions. An ErrorCode is sometimes called an HRESULT.

Implementations

impl ErrorCode[src]

pub fn is_ok(self) -> bool[src]

Returns true if self is a success code.

pub fn is_err(self) -> bool[src]

Returns true if self is a failure code.

pub fn unwrap(self)[src]

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.

pub fn ok(self) -> Result<()>[src]

Converts the ErrorCode to Result<()>.

pub fn and_some<T: Interface>(self, some: Option<T>) -> Result<T>[src]

Returns the Option as a Result if the option is a Some value, returning a suitable error if not.

pub fn and_then<F, T>(self, op: F) -> Result<T> where
    F: FnOnce() -> T, 
[src]

Calls op if self is a success code, otherwise returns ErrorCode converted to Result<T>.

pub unsafe fn from_abi<T: Abi>(self, abi: T::Abi) -> Result<T>[src]

If the Result is Ok converts the T::Abi into T.

pub fn from_thread() -> Self[src]

Retrieves the error code stored on the calling thread.

pub const S_OK: ErrorCode[src]

The operation succeeded.

pub const CO_E_NOTINITIALIZED: ErrorCode[src]

The COM runtime has not been loaded.

pub const E_NOINTERFACE: ErrorCode[src]

The requested interface is not implemented.

pub const E_POINTER: ErrorCode[src]

A null pointer was sent or received.

Trait Implementations

impl Abi for ErrorCode[src]

type Abi = Self

The abi representation of the implementing type. Read more

impl Clone for ErrorCode[src]

impl Copy for ErrorCode[src]

impl Debug for ErrorCode[src]

impl Default for ErrorCode[src]

impl From<Error> for ErrorCode[src]

impl From<ErrorCode> for Error[src]

impl<T> From<Result<T, Error>> for ErrorCode[src]

impl PartialEq<ErrorCode> for ErrorCode[src]

impl StructuralPartialEq for ErrorCode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.