Struct ffi_support::ErrorCode [−][src]
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]
fn cmp(&self, other: &ErrorCode) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<ErrorCode> for ErrorCode
[src]
impl PartialOrd<ErrorCode> for ErrorCode
[src]
fn partial_cmp(&self, other: &ErrorCode) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,