mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-05-12 12:49:36 +00:00
23 lines
426 B
Rust
23 lines
426 B
Rust
#[derive(Debug, Default, PartialEq, Eq)]
|
|
#[repr(C)]
|
|
pub enum OperationStatus {
|
|
#[default]
|
|
Ok = 0x0,
|
|
NullPointer = 0x1,
|
|
InitializationError = 0x2,
|
|
}
|
|
|
|
impl OperationStatus {
|
|
#[must_use]
|
|
#[unsafe(no_mangle)]
|
|
pub extern "C" fn is_ok(&self) -> bool {
|
|
*self == Self::Ok
|
|
}
|
|
|
|
#[must_use]
|
|
#[unsafe(no_mangle)]
|
|
pub extern "C" fn is_error(&self) -> bool {
|
|
!self.is_ok()
|
|
}
|
|
}
|