[][src]Struct ffi_support::ErrorCode

#[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.

Methods

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 Default for ErrorCode[src]

impl Clone for ErrorCode[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Ord for ErrorCode[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Eq for ErrorCode[src]

impl Copy for ErrorCode[src]

impl PartialOrd<ErrorCode> for ErrorCode[src]

impl PartialEq<ErrorCode> for ErrorCode[src]

impl Debug for ErrorCode[src]

Auto Trait Implementations

impl Send for ErrorCode

impl Sync for ErrorCode

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.