#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(unused_imports)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(clippy::unnecessary_cast)]
use crate::*;
use core::option::Option;
use core::ops::{Deref, DerefMut};
#[cfg(feature = "std")]
use std::io::{Read, Write};
#[cfg(feature = "xdrs")]
use xdrs::*;
#[cfg(feature = "serde")]
use ::serde::{{Serialize, Deserialize}};
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(transparent))]
#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[derive(Copy)]
#[repr(transparent)]
pub struct SyscallErrorCode(pub i32);
impl SyscallErrorCode {
pub const kSyscallErrorCodeNone: Self = Self(0);
pub const kSyscallErrorCodeFault: Self = Self(1);
pub const kSyscallErrorCodeNoSyscall: Self = Self(2);
pub const kSyscallErrorCodeIsRootTransaction: Self = Self(3);
pub const kSyscallErrorCodeReentrance: Self = Self(4);
pub const kSyscallErrorCodeContractAlreadyDeployed: Self = Self(5);
pub const kSyscallErrorCodeNoReturnBufferAvailable: Self = Self(6);
pub const kSyscallErrorCodeInvalidSyscallInput: Self = Self(7);
pub const kSyscallErrorCodeStorageKeyNotExist: Self = Self(8);
pub const kSyscallErrorCodeNoRetrocausalQueueEntry: Self = Self(9);
pub const kSyscallErrorCodeRetrocausalQueueReadLimitReached: Self = Self(10);
pub const kSyscallErrorCodeInvokeDepthExceeded: Self = Self(11);
}
impl From<i32> for SyscallErrorCode {
fn from(v: i32) -> Self {
Self(v)
}
}
#[cfg(feature = "std")]
impl core::fmt::Display for SyscallErrorCode {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self.0 {
x if x == Self::kSyscallErrorCodeNone.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeNone")
},
x if x == Self::kSyscallErrorCodeFault.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeFault")
},
x if x == Self::kSyscallErrorCodeNoSyscall.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeNoSyscall")
},
x if x == Self::kSyscallErrorCodeIsRootTransaction.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeIsRootTransaction")
},
x if x == Self::kSyscallErrorCodeReentrance.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeReentrance")
},
x if x == Self::kSyscallErrorCodeContractAlreadyDeployed.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeContractAlreadyDeployed")
},
x if x == Self::kSyscallErrorCodeNoReturnBufferAvailable.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeNoReturnBufferAvailable")
},
x if x == Self::kSyscallErrorCodeInvalidSyscallInput.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeInvalidSyscallInput")
},
x if x == Self::kSyscallErrorCodeStorageKeyNotExist.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeStorageKeyNotExist")
},
x if x == Self::kSyscallErrorCodeNoRetrocausalQueueEntry.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeNoRetrocausalQueueEntry")
},
x if x == Self::kSyscallErrorCodeRetrocausalQueueReadLimitReached.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeRetrocausalQueueReadLimitReached")
},
x if x == Self::kSyscallErrorCodeInvokeDepthExceeded.0 => {
write!(f, "SyscallErrorCode::kSyscallErrorCodeInvokeDepthExceeded")
},
_ => {
write!(f, "SyscallErrorCode({})", self.0)
}
}
}
}