mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-16 21:20:00 +00:00
24 lines
449 B
Rust
24 lines
449 B
Rust
#[derive(Debug, Default, PartialEq, Eq)]
|
|
#[repr(C)]
|
|
pub enum OperationStatus {
|
|
#[default]
|
|
Ok = 0x0,
|
|
NullPointer = 0x1,
|
|
InitializationError = 0x2,
|
|
ClientError = 0x3,
|
|
}
|
|
|
|
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()
|
|
}
|
|
}
|