Struct ffi_support::ErrorCode[][src]

#[repr(transparent)]pub struct ErrorCode(_);

A wrapper around error codes, which is represented identically to an i32 on the other side of the FFI. Essentially exists to check that we don’t accidentally reuse success/panic codes for other things.

Implementations

impl ErrorCode[src]

pub const SUCCESS: ErrorCode[src]

The ErrorCode used for success.

pub const PANIC: ErrorCode[src]

The ErrorCode used for panics. It’s unlikely you need to ever use this.

pub const INVALID_HANDLE: ErrorCode[src]

The ErrorCode used for handle map errors.

pub fn new(code: i32) -> Self[src]

Construct an error code from an integer code.

Panics

Panics if you call it with 0 (reserved for success, but you can use ErrorCode::SUCCESS if that’s what you want), or -1 (reserved for panics, but you can use ErrorCode::PANIC if that’s what you want).

pub fn code(self) -> i32[src]

Get the raw numeric value of this ErrorCode.

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

Returns whether or not this is a success code.

Trait Implementations

impl Clone for ErrorCode[src]

impl Copy for ErrorCode[src]

impl Debug for ErrorCode[src]

impl Default for ErrorCode[src]

impl Eq for ErrorCode[src]

impl Ord for ErrorCode[src]

impl PartialEq<ErrorCode> for ErrorCode[src]

impl PartialOrd<ErrorCode> for ErrorCode[src]

impl StructuralEq for ErrorCode[src]

impl StructuralPartialEq for ErrorCode[src]

Auto Trait Implementations

impl RefUnwindSafe for ErrorCode

impl Send for ErrorCode

impl Sync for ErrorCode

impl Unpin for ErrorCode

impl UnwindSafe for ErrorCode

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.