Skip to main content

stellar_xdr/generated/
config_setting_contract_parallel_compute_v0.rs

1#[allow(unused_imports, clippy::wildcard_imports)]
2use super::*;
3
4/// ConfigSettingContractParallelComputeV0 is an XDR Struct defined as:
5///
6/// ```text
7/// struct ConfigSettingContractParallelComputeV0
8/// {
9///     // Maximum number of clusters with dependent transactions allowed in a
10///     // stage of parallel tx set component.
11///     // This effectively sets the lower bound on the number of physical threads
12///     // necessary to effectively apply transaction sets in parallel.
13///     uint32 ledgerMaxDependentTxClusters;
14/// };
15/// ```
16///
17#[cfg_attr(feature = "alloc", derive(Default))]
18#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
19#[cfg_attr(feature = "serde", cfg_eval::cfg_eval)]
20#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21#[cfg_attr(
22    all(feature = "serde", feature = "alloc"),
23    serde_with::serde_as,
24    derive(serde::Serialize, serde::Deserialize),
25    serde(rename_all = "snake_case")
26)]
27#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
28pub struct ConfigSettingContractParallelComputeV0 {
29    pub ledger_max_dependent_tx_clusters: u32,
30}
31
32impl ReadXdr for ConfigSettingContractParallelComputeV0 {
33    #[cfg(feature = "std")]
34    fn read_xdr<R: Read>(r: &mut Limited<R>) -> Result<Self, Error> {
35        r.with_limited_depth(|r| {
36            Ok(Self {
37                ledger_max_dependent_tx_clusters: u32::read_xdr(r)?,
38            })
39        })
40    }
41}
42
43impl WriteXdr for ConfigSettingContractParallelComputeV0 {
44    #[cfg(feature = "std")]
45    fn write_xdr<W: Write>(&self, w: &mut Limited<W>) -> Result<(), Error> {
46        w.with_limited_depth(|w| {
47            self.ledger_max_dependent_tx_clusters.write_xdr(w)?;
48            Ok(())
49        })
50    }
51}