pub fn wrap_error(code: u32) -> NativeError {
    match code {
        0 => NativeError::NoError,
        98 => NativeError::NotAvailable,
        99 => NativeError::MustPossessCapability,
        100 => NativeError::NullPointer,
        110 => NativeError::OutOfMemory,
        111 => NativeError::NotEnabled,
        112 => NativeError::WrongPhase,
        113 => NativeError::UnexpectedInternalError,
        115 => NativeError::ThreadNotAttached,
        116 => NativeError::Disconnected,
        999999 => NativeError::NotImplemented,
        _ => { println!("Unknown error code was detected: {}", code); NativeError::UnknownError }
    }
}
/// Turn a native error code into a type-safe error
Turn a native error code into a type-safe error
Turn a native error code into a type - safe error
pub fn wrap_error(code: u32) -> NativeError {
    match code {
        0 => NativeError::NoError,
        98 => NativeError::NotAvailable,
        99 => NativeError::MustPossessCapability,
        100 => NativeError::NullPointer,
        110 => NativeError::OutOfMemory,
        111 => NativeError::NotEnabled,
        112 => NativeError::WrongPhase,
        113 => NativeError::UnexpectedInternalError,
        115 => NativeError::ThreadNotAttached,
        116 => NativeError::Disconnected,
        999999 => NativeError::NotImplemented,
        _ => { println!("Unknown error code was detected: {}", code); NativeError::UnknownError }
    }
}
pub fn wrap_error ( code : u32 ) -> NativeError { match code { 0 => NativeError :: NoError , 98 => NativeError :: NotAvailable , 99 => NativeError :: MustPossessCapability , 100 => NativeError :: NullPointer , 110 => NativeError :: OutOfMemory , 111 => NativeError :: NotEnabled , 112 => NativeError :: WrongPhase , 113 => NativeError :: UnexpectedInternalError , 115 => NativeError :: ThreadNotAttached , 116 => NativeError :: Disconnected , 999999 => NativeError :: NotImplemented , _ => { println ! ( " " code ) ; NativeError :: UnknownError } } }
Turn a native error code into a type-safe error
Turn a native error code into a type - safe error
code
u32
code
u32