Skip to main content

thruput_xdr/
precompiles.rs

1// -*-Rust-*-
2// Generated Code: DO NOT CHECK IN
3
4// Generated from xdrc commit: 6ab835b07c234abb4b0b50b61d687904727a4f32
5
6#![allow(non_camel_case_types)]
7#![allow(non_snake_case)]
8#![allow(non_upper_case_globals)]
9#![allow(unused_imports)]
10#![allow(dead_code)]
11#![allow(unused_variables)]
12#![allow(clippy::unnecessary_cast)]
13
14use crate::*;
15use core::option::Option;
16use core::ops::{Deref, DerefMut};
17
18#[cfg(feature = "std")]
19use std::io::{Read, Write};
20#[cfg(feature = "xdrs")]
21use xdrs::*;
22
23
24#[cfg(feature = "serde")]
25use ::serde::{{Serialize, Deserialize}};
26
27
28// These define the native contract IDs within the Contract struct.
29#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30#[cfg_attr(feature = "serde", serde(transparent))]
31#[cfg_attr(feature = "xdrs", derive(ReadXDR, WriteXDR, ConstXDRSize))]
32#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
33#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
34#[derive(Copy)]
35#[repr(transparent)]
36pub struct HogexecPrecompiledNativeContracts(pub i32);
37
38impl HogexecPrecompiledNativeContracts {
39    pub const kNativeContractNativeToken: Self = Self(0);
40
41    // Native contract ID 1 is retired and must remain unused.
42    pub const kNativeContractDefaultWallet: Self = Self(2);
43}
44impl From<i32> for HogexecPrecompiledNativeContracts {
45    fn from(v: i32) -> Self {
46        Self(v)
47    }
48}
49#[cfg(feature = "std")]
50impl core::fmt::Display for HogexecPrecompiledNativeContracts {
51    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
52        match self.0 {
53            x if x == Self::kNativeContractNativeToken.0 => {
54                write!(f, "HogexecPrecompiledNativeContracts::kNativeContractNativeToken")
55            },
56            x if x == Self::kNativeContractDefaultWallet.0 => {
57                write!(f, "HogexecPrecompiledNativeContracts::kNativeContractDefaultWallet")
58            },
59            _ => {
60                write!(f, "HogexecPrecompiledNativeContracts({})", self.0)
61            }
62        }
63    }
64}
65
66
67
68//
69// XDR internals below this point
70//
71
72