pub struct LVStatusCode(/* private fields */);
Expand description
´LVStatusCode´ is a transparent newtype on i32 to represent all potential error codes and SUCCESS (0) as a success value.
This kind of status code corresponds to the Rust Result types. Therefore, it is named status and not error on purpose. There is no checks or guarantees if the code is a valid range or has an official labview definition.
§Examples
use labview_interop::types::LVStatusCode;
let status = LVStatusCode::from(42);
assert_eq!(status, 42.into());
Implementations§
Source§impl LVStatusCode
impl LVStatusCode
pub fn description(&self) -> Cow<'static, str>
Source§impl LVStatusCode
impl LVStatusCode
pub const SUCCESS: LVStatusCode
Sourcepub fn to_generic_result<T>(self, success_value: T) -> Result<T, LVInteropError>
pub fn to_generic_result<T>(self, success_value: T) -> Result<T, LVInteropError>
this will convert the LVStatusCode to the generic LVError with no checks of validity
Trait Implementations§
Source§impl Clone for LVStatusCode
impl Clone for LVStatusCode
Source§fn clone(&self) -> LVStatusCode
fn clone(&self) -> LVStatusCode
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 LVStatusCode
impl Debug for LVStatusCode
Source§impl Display for LVStatusCode
impl Display for LVStatusCode
Source§impl Error for LVStatusCode
impl Error for LVStatusCode
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<&LVInteropError> for LVStatusCode
impl From<&LVInteropError> for LVStatusCode
Source§fn from(value: &LVInteropError) -> Self
fn from(value: &LVInteropError) -> Self
Converts to this type from the input type.
Source§impl From<&MgError> for LVStatusCode
impl From<&MgError> for LVStatusCode
Source§fn from(errcode: &MgError) -> LVStatusCode
fn from(errcode: &MgError) -> LVStatusCode
Converts to this type from the input type.
Source§impl From<LVInteropError> for LVStatusCode
impl From<LVInteropError> for LVStatusCode
Source§fn from(value: LVInteropError) -> Self
fn from(value: LVInteropError) -> Self
Converts to this type from the input type.
Source§impl From<LVStatusCode> for LVInteropError
impl From<LVStatusCode> for LVInteropError
Source§fn from(status: LVStatusCode) -> Self
fn from(status: LVStatusCode) -> Self
Converts to this type from the input type.
Source§impl From<LVStatusCode> for i32
impl From<LVStatusCode> for i32
Source§fn from(code: LVStatusCode) -> i32
fn from(code: LVStatusCode) -> i32
Converts to this type from the input type.
Source§impl From<MgError> for LVStatusCode
impl From<MgError> for LVStatusCode
Source§fn from(errcode: MgError) -> LVStatusCode
fn from(errcode: MgError) -> LVStatusCode
Converts to this type from the input type.
Source§impl<T> From<Result<T, LVInteropError>> for LVStatusCode
the conversion from LVInteropError back to LVStatusCode is important
to return the status in extern “C” functions back to LV
impl<T> From<Result<T, LVInteropError>> for LVStatusCode
the conversion from LVInteropError back to LVStatusCode is important to return the status in extern “C” functions back to LV
Source§impl From<i32> for LVStatusCode
impl From<i32> for LVStatusCode
Source§fn from(value: i32) -> LVStatusCode
fn from(value: i32) -> LVStatusCode
Converts to this type from the input type.
Source§impl PartialEq for LVStatusCode
impl PartialEq for LVStatusCode
Source§impl TryFrom<LVStatusCode> for MgError
impl TryFrom<LVStatusCode> for MgError
Source§type Error = LVInteropError
type Error = LVInteropError
The type returned in the event of a conversion error.
impl Copy for LVStatusCode
impl Eq for LVStatusCode
impl StructuralPartialEq for LVStatusCode
Auto Trait Implementations§
impl Freeze for LVStatusCode
impl RefUnwindSafe for LVStatusCode
impl Send for LVStatusCode
impl Sync for LVStatusCode
impl Unpin for LVStatusCode
impl UnwindSafe for LVStatusCode
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