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

impl PartialOrd<ErrorCode> for ErrorCode[src]

impl Eq for ErrorCode[src]

impl Ord for ErrorCode[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

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

Restrict a value to a certain interval. Read more

impl Copy for ErrorCode[src]

impl Debug for ErrorCode[src]

Auto Trait Implementations

Blanket Implementations

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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.

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

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

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