Skip to main content

stellar_xdr/generated/
soroban_resources_ext_v0.rs

1#[allow(unused_imports, clippy::wildcard_imports)]
2use super::*;
3
4/// SorobanResourcesExtV0 is an XDR Struct defined as:
5///
6/// ```text
7/// struct SorobanResourcesExtV0
8/// {
9///     // Vector of indices representing what Soroban
10///     // entries in the footprint are archived, based on the
11///     // order of keys provided in the readWrite footprint.
12///     uint32 archivedSorobanEntries<>;
13/// };
14/// ```
15///
16#[cfg_attr(feature = "alloc", derive(Default))]
17#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
18#[cfg_attr(feature = "serde", cfg_eval::cfg_eval)]
19#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20#[cfg_attr(
21    all(feature = "serde", feature = "alloc"),
22    serde_with::serde_as,
23    derive(serde::Serialize, serde::Deserialize),
24    serde(rename_all = "snake_case")
25)]
26#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
27pub struct SorobanResourcesExtV0 {
28    pub archived_soroban_entries: VecM<u32>,
29}
30
31impl ReadXdr for SorobanResourcesExtV0 {
32    #[cfg(feature = "std")]
33    fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> {
34        r.with_limited_depth(|r| {
35            Ok(Self {
36                archived_soroban_entries: VecM::<u32>::read_xdr(r)?,
37            })
38        })
39    }
40}
41
42impl WriteXdr for SorobanResourcesExtV0 {
43    #[cfg(feature = "std")]
44    fn write_xdr<W: Write>(&self, w: &mut Limited<W>) -> Result<(), Error> {
45        w.with_limited_depth(|w| {
46            self.archived_soroban_entries.write_xdr(w)?;
47            Ok(())
48        })
49    }
50}