#[repr(i32)]pub enum InternalError {
Misc = 542_000,
NoLabviewApi(String),
InvalidHandle = 542_002,
ArrayDimensionsOutOfRange = 542_003,
ArrayDimensionMismatch = 542_004,
HandleCreationFailed = 542_005,
InvalidMgErrorCode = 542_006,
}
Expand description
§Examples
use labview_interop::errors::{MgError, LVInteropError};
use labview_interop::types::LVStatusCode;
use std::convert::TryFrom;
let status = LVStatusCode::from(2);
let result: Result<MgError, LVInteropError> = MgError::try_from(status);
assert!(result.is_ok());
assert_eq!(result.unwrap(), MgError::MFullErr);
let status = LVStatusCode::from(0);
let result: Result<MgError, LVInteropError> = MgError::try_from(status);
assert!(result.is_err());
let error = MgError::BogusError;
let error_code: i32 = error.into();
assert_eq!(error_code, 42);
LVInteropError is our internal Error type in order to be able to easily convert it to LV ErrorClusters all Errors should possess an Error Code
Our choice of a custom ranges in Labview is (see comment above on valid ranges) 542,000 to 542,999
Variants§
Misc = 542_000
NoLabviewApi(String)
InvalidHandle = 542_002
ArrayDimensionsOutOfRange = 542_003
ArrayDimensionMismatch = 542_004
HandleCreationFailed = 542_005
InvalidMgErrorCode = 542_006
Trait Implementations§
Source§impl Clone for InternalError
impl Clone for InternalError
Source§fn clone(&self) -> InternalError
fn clone(&self) -> InternalError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for InternalError
impl Debug for InternalError
Source§impl Display for InternalError
impl Display for InternalError
Source§impl Error for InternalError
impl Error for InternalError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<&InternalError> for LVStatusCode
impl From<&InternalError> for LVStatusCode
Source§fn from(err: &InternalError) -> LVStatusCode
fn from(err: &InternalError) -> LVStatusCode
Converts to this type from the input type.
Source§impl From<InternalError> for LVInteropError
impl From<InternalError> for LVInteropError
Source§fn from(source: InternalError) -> Self
fn from(source: InternalError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for InternalError
impl PartialEq for InternalError
impl StructuralPartialEq for InternalError
Auto Trait Implementations§
impl Freeze for InternalError
impl RefUnwindSafe for InternalError
impl Send for InternalError
impl Sync for InternalError
impl Unpin for InternalError
impl UnwindSafe for InternalError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more